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 layers #571

Merged
merged 12 commits into from
Jun 21, 2023
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +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/" layers from Asiaq/NunaGIS:
- Buildings
- Roads


# v3.0.0alpha2 (2023-05-09)
Expand Down
141 changes: 97 additions & 44 deletions qgreenland/ancillary/styles/buildings_shape.qml

Large diffs are not rendered by default.

209 changes: 143 additions & 66 deletions qgreenland/ancillary/styles/roads_line.qml

Large diffs are not rendered by default.

115 changes: 114 additions & 1 deletion qgreenland/config/cfg-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,39 @@
"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"
},
"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",
"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": {
Expand Down Expand Up @@ -3460,14 +3493,94 @@
"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"
},
{
"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",
"settings": {
"expand": false,
"order": [
":populated_places",
":comprehensive_places"
":comprehensive_places",
":buildings",
":roads"
],
"show": false
}
Expand Down
30 changes: 30 additions & 0 deletions qgreenland/config/datasets/asiaq_nunagis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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",
),
# "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",
"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",
},
},
)
2 changes: 2 additions & 0 deletions qgreenland/config/layers/Places/__settings__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
order=[
":populated_places",
":comprehensive_places",
":buildings",
":roads",
],
)
25 changes: 25 additions & 0 deletions qgreenland/config/layers/Places/buildings.py
Original file line number Diff line number Diff line change
@@ -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,
),
],
)
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,
),
],
)