Add Open Data & Basemaps
ទាញយកព្រំដែនរដ្ឋបាល ផែនទីមូលដ្ឋាន ទិន្នន័យកម្ពស់ និងគម្របដី ចូលទៅក្នុងគម្រោងដោយផ្ទាល់ ដោយមិនចាំបាច់ឆ្លងកាត់ browser។
- រកឃើញនៅឯណា
- Processing ▸ Toolbox ▸ KGA Toolbox ▸ KGA Data Management ▸ Add Open Data & Basemaps
- លេខសម្គាល់ algorithm
- kga:add_data
- ប្រភេទឧបករណ៍
- Interactive dialog — modeless, needs the QGIS window and an internet connection
ទិដ្ឋភាពទូទៅ
Pick a country and an admin level; the tool asks the data source what it publishes, shows you who produced it, which year it represents, under what licence and how many features it holds, then downloads it and adds it to the map.
Boundary sources
| Source | Coverage | Licence |
|---|---|---|
| geoBoundaries | Global, ADM0 to ADM5 where it exists. Each country's own source and licence carried through. | Varies by country — shown before you download |
| HDX / OCHA COD-AB | The p-coded boundaries the humanitarian community agrees on, ADM0 to ADM3 or 4. | Usually CC BY-IGO |
| Natural Earth | Country and state outlines worldwide, at three generalisations, filtered to the country you pick. | Public domain |
| Custom URL | Any GeoJSON file, ArcGIS REST layer or WFS endpoint. | Set by whoever publishes it |
| KGA Database (PostgreSQL) | Listed but not connected yet. | — |
Elevation and land cover
- Copernicus DEM (AWS open data) — GLO-30 (~30 m) and GLO-90 (~90 m), no account needed.
- OpenTopography Global DEM API — Copernicus, SRTM GL1/GL3, NASADEM, ALOS AW3D30, EU DTM, SRTM15+, GEBCO and GEDI L3, with a free API key.
- Esri Land Cover and ESA WorldCover — both 10 m, CC BY 4.0, no account.
Vector data arrives as a temporary scratch layer. It lives in memory and is lost when the project closes. Export it to a GeoPackage or shapefile to keep it — the tool says so, and offers a Save layer… button, every time. Basemaps are the exception: an XYZ layer is a reference to a URL, so it saves into the project file normally.
ប៉ារ៉ាម៉ែត្រ
The algorithm takes no Processing parameters — running it opens the window. The controls below are the window's, and the form rearranges itself so only the ones the current choice needs are on screen.
| ផ្ទាំងគ្រប់គ្រង | ប្រភេទ | តម្លៃលំនាំដើម | ការពិពណ៌នា |
|---|---|---|---|
| Data type | Combo box | Administrative boundaries | Administrative boundaries, Other vector data, Basemap tile layer, Open digital elevation (DEM), Open land cover (LULC). Decides which sources are offered and which rows appear. |
| Data source | Combo box | geoBoundaries | The portal to read. A source that is listed but greyed out is one the tool knows about and cannot reach yet; its tooltip says why. |
| Country | Editable combo box | Cambodia (KHM) | Type to filter. Hidden for the custom sources, and for Natural Earth when its Extent is set to the whole world. |
| Admin level | Combo box | ADM1 | ADM0 country, ADM1 province/state, ADM2 district, ADM3 commune, ADM4 village, ADM5. Levels the country does not publish are shown but disabled, so a missing ADM4 is visibly missing rather than silently absent. |
| Release | Combo box | gbOpen | geoBoundaries only. gbOpen has the widest coverage; gbHumanitarian is UN OCHA sourced; gbAuthoritative is UN SALB official data. |
| Geometry | Combo box | Simplified | geoBoundaries only. Simplified is right for mapping and context. Take Full detail only when the exact boundary line matters — it can be many times larger. |
| Extent | Combo box | Selected country only | Natural Earth only. Its files are worldwide; this cuts the chosen country out as the layer loads. |
| Scale | Combo box | 1:10m | Natural Earth only. 1:10m, 1:50m, 1:110m — admin 1 is only worldwide at 1:10m. That file is about 40 MB, downloaded once and cached. |
| Address | Text | empty | Custom sources only. A https:// address — a GeoJSON file, an ArcGIS FeatureServer layer, or a WFS endpoint. Local file paths are refused on purpose; use Layer Export / Import for those. |
| Zoom levels | Two spin boxes | the service's own range | Basemaps only. Narrow the range QGIS will request tiles for. |
| Also add it to the Browser panel, permanently | Checkbox | off | Basemaps only. Writes the tile service into XYZ Tiles in the Browser, so it is there in every project without coming back here. |
| Dataset | Combo box | GLO-30 / COP30 | DEM only. The elevation model to read. |
| Year | Combo box | the latest published | Land cover only. The year the map represents. Each map summarises that whole year. |
| API key | Password + Remember | empty | OpenTopography only. Free from OpenTopography. Remember keeps it encrypted in the QGIS password store, never in plain settings. |
| Area | Combo box | Current map extent | DEM and land cover. Current map extent, a rectangle or polygon drawn on the map, a polygon layer's boundary, or the extent of any layer. A drawn or boundary area cuts the raster to the shape, with NoData outside. |
| Selected features only | Checkbox | off | DEM and land cover, boundary only. Clip to the selected polygons rather than all of them. |
| Reproject to the project CRS | Checkbox | off | DEM and land cover. A DEM is warped with bilinear resampling; land cover with nearest-neighbour, so no class is ever invented. Off keeps the published grid exactly. |
| Also add as polygons (lc_code, lc_class) | Checkbox | off | Land cover only. Also turn the classes into polygons, written to a GeoPackage beside the GeoTIFF. Limited to 60 million pixels — about 6,000 km² at 10 m. |
| Save to | File | empty | DEM and land cover. Where to write the GeoTIFF. Empty means a temporary file, deleted when QGIS closes. |
| Layer name | Text | the source's own name | Auto-fills from the selection and keeps following it — until you type in it, after which your text is kept. |
Buttons
| ផ្ទាំងគ្រប់គ្រង | ប្រភេទ | តម្លៃលំនាំដើម | ការពិពណ៌នា |
|---|---|---|---|
| Add to Map | Button | — | Download if needed, then add the layer. |
| Refresh | Button | — | Forget what is cached for the current selection and re-read the source. Use this if a download was interrupted or the source has republished. |
| Clear cache | Button | — | Delete everything the tool has downloaded. Layers already on the map are unaffected — they hold their own copy in memory. |
របៀបប្រើ
- Open KGA Data Management > Add Open Data & Basemaps, or press its button on the KGA toolbar.
- Choose a Data type — boundaries, other vector data, a basemap, a DEM or land cover.
- Pick the Data source, then the Country and Admin level (or, for a raster, the Dataset or Year and the Area).
- Read the details panel: publisher, year, licence, feature count, and for a raster the area in km² and the estimated output size.
- Press Add to Map.
- For vector data, export the scratch layer somewhere permanent before closing the project — the message bar offers Save layer….
លទ្ធផល
- Boundaries and other vector data — a memory (scratch) layer in the source's own CRS, carrying the publisher, licence and source address in the layer metadata. A name already taken becomes
name (2). - A WFS address — a live WFS layer, read from the service on demand. This one is not a scratch layer.
- DEM — a GeoTIFF (Float32 or Int16, DEFLATE, NoData −32767) in EPSG:4326 or the project CRS.
- Land cover — a classified GeoTIFF whose pixel values are the publisher's class codes, with class names, the publisher's colour table and a raster attribute table in the
.tif.aux.xmlbeside it, which ArcGIS reads as well as QGIS. It opens with a paletted legend such as2 - Trees, saved as a.qmlso it opens styled next time. - Land cover polygons — optional GeoPackage layer
landcoverwithlc_codeandlc_class, one polygon per connected patch. - Basemap — an XYZ raster layer in EPSG:3857, placed at the bottom of the layer tree.
កំណត់សម្គាល់ និងដែនកំណត់
- Downloads are cached. Adding the same boundary twice costs one download, and the second works with the network unplugged. The cache lives under the QGIS profile directory (
kga_tools/data_cache) and is trimmed, least recently used first, once it passes 500 MB. - Natural Earth's ADM1 coverage is not the same at every scale — 251 countries at 1:10m, nine at 1:50m, the USA only at 1:110m. ADM1 is greyed out where the file has nothing. Its 24 Cambodian units are its own generalisation, not the official 25 — use geoBoundaries or HDX when the province count has to be right.
- One HDX download carries every level. COD-AB publishes a single zipped shapefile holding ADM0 to ADM3 together, so switching level after the first add costs nothing.
- Attribution is required by every source here, including the basemaps. The licence is shown before the download, written into the layer's metadata, and travels with the layer when it is exported.
- Copernicus tiles are streamed, not downloaded. They are Cloud Optimised GeoTIFFs in a public AWS bucket, so only the part inside your area crosses the network.
- Requests have ceilings. Over 700 million pixels is refused for a DEM, 500 million for land cover; OpenTopography's own limits are checked too.
- The Google basemaps come with a licensing caveat. Google's tile endpoints are not licensed for use outside Google's own APIs and SDKs, so whether a particular deliverable may use them is a question for whoever makes it.
- A token pasted into a custom address never travels. The layer's recorded source address and attribution are written without user name, password or query string.
- Coverage is the publisher's, not the tool's. A greyed-out level is the source saying it has nothing. Trying another release or another source is often the answer.
- The window needs the QGIS canvas and cannot run headless or inside a Processing model.