diff --git a/CHANGELOG.md b/CHANGELOG.md index af0cd936..1fc2f33a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ 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. +- Add new "Places/" layers from Asiaq/NunaGIS: + - Buildings + - Roads # v3.0.0alpha2 (2023-05-09) diff --git a/qgreenland/ancillary/styles/roads_line.qml b/qgreenland/ancillary/styles/roads_line.qml index 2433351f..91d55352 100644 --- a/qgreenland/ancillary/styles/roads_line.qml +++ b/qgreenland/ancillary/styles/roads_line.qml @@ -1,25 +1,45 @@ - - + + - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + 0 0 - 1 1 diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index 06690d9e..e0331362 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -80,6 +80,16 @@ "\"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" + }, + "roads": { + "args": [ + "ogr2ogr", + "-oo", + "FEATURE_SERVER_PAGING=YES", + "{output_dir}/fetched.geojson", + "\"https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer/38/query/?f=json&where=OBJECTID+is+not+null&outFields=*&orderByFields=OBJECTID+ASC\"" + ], + "id": "roads" } }, "id": "asiaq_nunagis", @@ -3522,6 +3532,45 @@ "title": "Buildings" }, "name": "buildings" + }, + { + "layer_cfg": { + "description": "Lines representing roads in Greenland.", + "id": "roads", + "in_package": true, + "input": { + "asset": { + "id": "roads" + }, + "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": "roads_line", + "tags": [ + "places" + ], + "title": "Roads" + }, + "name": "roads" } ], "name": "Places", @@ -3530,7 +3579,8 @@ "order": [ ":populated_places", ":comprehensive_places", - ":buildings" + ":buildings", + ":roads" ], "show": false } diff --git a/qgreenland/config/datasets/asiaq_nunagis.py b/qgreenland/config/datasets/asiaq_nunagis.py index 8180358d..9682a529 100644 --- a/qgreenland/config/datasets/asiaq_nunagis.py +++ b/qgreenland/config/datasets/asiaq_nunagis.py @@ -9,6 +9,12 @@ 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", ), + # "VEJMIDTE" means "MIDDLE OF THE ROAD" according to Google Translate + ogr_remote_asset( + asset_id="roads", + output_file="{output_dir}/fetched.geojson", + url="https://kort.nunagis.gl/refserver/rest/services/Kortportal/Kortportal_TekniskGrundkort/MapServer/38/query/?f=json&where=OBJECTID+is+not+null&outFields=*&orderByFields=OBJECTID+ASC", + ), ], metadata={ "title": "Asiaq Map Portal Techincal Basemap", diff --git a/qgreenland/config/layers/Places/__settings__.py b/qgreenland/config/layers/Places/__settings__.py index 1256f2e8..321c3a60 100644 --- a/qgreenland/config/layers/Places/__settings__.py +++ b/qgreenland/config/layers/Places/__settings__.py @@ -5,5 +5,6 @@ ":populated_places", ":comprehensive_places", ":buildings", + ":roads", ], ) diff --git a/qgreenland/config/layers/Places/roads.py b/qgreenland/config/layers/Places/roads.py new file mode 100644 index 00000000..f4b57805 --- /dev/null +++ b/qgreenland/config/layers/Places/roads.py @@ -0,0 +1,23 @@ +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 + +roads = Layer( + id="roads", + title="Roads", + style="roads_line", + description="""Lines representing roads in Greenland.""", + tags=["places"], + input=LayerInput( + dataset=asiaq_nunagis, + asset=asiaq_nunagis.assets["roads"], + ), + steps=[ + *ogr2ogr( + input_file="{input_dir}/fetched.geojson", + output_file="{output_dir}/final.gpkg", + boundary_filepath=project.boundaries["data"].filepath, + ), + ], +)