From 5e65dbf2919ba8982a4c81dc25f6002c129e2078 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 20 Jun 2023 16:55:13 -0600 Subject: [PATCH 1/4] Add buildings layer from Asiaq/NunaGIS TODO: better citation? --- qgreenland/config/datasets/asiaq_nunagis.py | 24 ++++++++++++++++++ .../config/layers/Places/__settings__.py | 1 + qgreenland/config/layers/Places/buildings.py | 25 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 qgreenland/config/datasets/asiaq_nunagis.py create mode 100644 qgreenland/config/layers/Places/buildings.py diff --git a/qgreenland/config/datasets/asiaq_nunagis.py b/qgreenland/config/datasets/asiaq_nunagis.py new file mode 100644 index 00000000..8180358d --- /dev/null +++ b/qgreenland/config/datasets/asiaq_nunagis.py @@ -0,0 +1,24 @@ +from qgreenland.config.helpers.assets.ogr_remote import ogr_remote_asset +from qgreenland.models.config.dataset import Dataset + +asiaq_nunagis = Dataset( + id="asiaq_nunagis", + assets=[ + ogr_remote_asset( + asset_id="buildings", + output_file="{output_dir}/fetched.geojson", + url="https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer/82/query/?f=json&where=OBJECTID+is+not+null&outFields=*&orderByFields=OBJECTID+ASC", + ), + ], + metadata={ + "title": "Asiaq Map Portal Techincal Basemap", + "abstract": ( + """The NunaGIS data server provides data for the the Asiaq Map + Portal Technical Basemap, which includes a variety of datasets.""" + ), + "citation": { + "text": ("""NunaGIS (2023). Date accessed: {{date_accessed}}."""), + "url": "https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer", + }, + }, +) diff --git a/qgreenland/config/layers/Places/__settings__.py b/qgreenland/config/layers/Places/__settings__.py index 3a1e8337..1256f2e8 100644 --- a/qgreenland/config/layers/Places/__settings__.py +++ b/qgreenland/config/layers/Places/__settings__.py @@ -4,5 +4,6 @@ order=[ ":populated_places", ":comprehensive_places", + ":buildings", ], ) diff --git a/qgreenland/config/layers/Places/buildings.py b/qgreenland/config/layers/Places/buildings.py new file mode 100644 index 00000000..97aa9927 --- /dev/null +++ b/qgreenland/config/layers/Places/buildings.py @@ -0,0 +1,25 @@ +from qgreenland.config.datasets.asiaq_nunagis import asiaq_nunagis +from qgreenland.config.helpers.steps.ogr2ogr import ogr2ogr +from qgreenland.config.project import project +from qgreenland.models.config.layer import Layer, LayerInput + +buildings = Layer( + id="buildings", + title="Buildings", + style="buildings_shape", + description="""Polygons representing buildings in Greenland. + + The attribute containing building use is called ‘Info’ and is provided in Danish.""", + tags=["places"], + input=LayerInput( + dataset=asiaq_nunagis, + asset=asiaq_nunagis.assets["buildings"], + ), + steps=[ + *ogr2ogr( + input_file="{input_dir}/fetched.geojson", + output_file="{output_dir}/final.gpkg", + boundary_filepath=project.boundaries["data"].filepath, + ), + ], +) From f8374230e361892b8fa9403c62801cac1b038254 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 20 Jun 2023 17:06:37 -0600 Subject: [PATCH 2/4] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91f575ed..af0cd936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ mentioned "Internet-required data/Topographic map of Greenland" WMS layer. - Add new "Internet-required data/Blue Marble shaded relief and Bathymetry (500m)" WMS layer from NASA Global Imagery Browse Services (GIBS) +- Add new "Places/Buildings" layer from Asiaq/NunaGIS. # v3.0.0alpha2 (2023-05-09) From f33f17175bb39874d4dbb0ca7f0742594834c54f Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 20 Jun 2023 17:06:47 -0600 Subject: [PATCH 3/4] update config lockfile --- qgreenland/config/cfg-lock.json | 65 ++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index 20160f36..06690d9e 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -69,6 +69,29 @@ "title": "Circumpolar Arctic Vegetation, Geobotanical, Physiographic Maps, 1982-2003" } }, + "asiaq_nunagis": { + "assets": { + "buildings": { + "args": [ + "ogr2ogr", + "-oo", + "FEATURE_SERVER_PAGING=YES", + "{output_dir}/fetched.geojson", + "\"https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer/82/query/?f=json&where=OBJECTID+is+not+null&outFields=*&orderByFields=OBJECTID+ASC\"" + ], + "id": "buildings" + } + }, + "id": "asiaq_nunagis", + "metadata": { + "abstract": "The NunaGIS data server provides data for the the Asiaq Map\nPortal Technical Basemap, which includes a variety of datasets.", + "citation": { + "text": "NunaGIS (2023). Date accessed: {{date_accessed}}.", + "url": "https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer" + }, + "title": "Asiaq Map Portal Techincal Basemap" + } + }, "asiaq_private_placenames": { "assets": { "only": { @@ -3460,6 +3483,45 @@ "title": "Place names database" }, "name": "comprehensive_places" + }, + { + "layer_cfg": { + "description": "Polygons representing buildings in Greenland.\n\nThe attribute containing building use is called \u2018Info\u2019 and is provided in Danish.", + "id": "buildings", + "in_package": true, + "input": { + "asset": { + "id": "buildings" + }, + "dataset": { + "id": "asiaq_nunagis" + } + }, + "show": false, + "steps": [ + { + "args": [ + "ogr2ogr", + "-lco", + "ENCODING=UTF-8", + "-t_srs", + "EPSG:3413", + "-clipdst", + "{assets_dir}/greenland_rectangle.geojson", + "-makevalid", + "{output_dir}/final.gpkg", + "{input_dir}/fetched.geojson" + ], + "type": "command" + } + ], + "style": "buildings_shape", + "tags": [ + "places" + ], + "title": "Buildings" + }, + "name": "buildings" } ], "name": "Places", @@ -3467,7 +3529,8 @@ "expand": false, "order": [ ":populated_places", - ":comprehensive_places" + ":comprehensive_places", + ":buildings" ], "show": false } From 47d9a74d6abc53938c59969449618277bc0ca5c5 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 20 Jun 2023 17:15:58 -0600 Subject: [PATCH 4/4] update buildings_shape style update labeling config to use "info" field instead of "name" --- .../ancillary/styles/buildings_shape.qml | 141 ++++++++++++------ 1 file changed, 97 insertions(+), 44 deletions(-) diff --git a/qgreenland/ancillary/styles/buildings_shape.qml b/qgreenland/ancillary/styles/buildings_shape.qml index 26d9b570..0463faf4 100644 --- a/qgreenland/ancillary/styles/buildings_shape.qml +++ b/qgreenland/ancillary/styles/buildings_shape.qml @@ -1,20 +1,29 @@ - - + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + 0 0 - 1 2