Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asiaq nunagis roads layer #569

Merged
merged 6 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
209 changes: 143 additions & 66 deletions qgreenland/ancillary/styles/roads_line.qml

Large diffs are not rendered by default.

52 changes: 51 additions & 1 deletion qgreenland/config/cfg-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -3530,7 +3579,8 @@
"order": [
":populated_places",
":comprehensive_places",
":buildings"
":buildings",
":roads"
],
"show": false
}
Expand Down
6 changes: 6 additions & 0 deletions qgreenland/config/datasets/asiaq_nunagis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions qgreenland/config/layers/Places/__settings__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
":populated_places",
":comprehensive_places",
":buildings",
":roads",
],
)
23 changes: 23 additions & 0 deletions qgreenland/config/layers/Places/roads.py
Original file line number Diff line number Diff line change
@@ -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,
),
],
)