Skip to content

Commit

Permalink
Merge pull request #568 from nsidc/asiaq-nunagis-buildings-layer
Browse files Browse the repository at this point in the history
Add buildings layer from Asiaq/NunaGIS
  • Loading branch information
trey-stafford authored Jun 21, 2023
2 parents e590772 + 47d9a74 commit a11a11b
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 45 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
141 changes: 97 additions & 44 deletions qgreenland/ancillary/styles/buildings_shape.qml

Large diffs are not rendered by default.

65 changes: 64 additions & 1 deletion qgreenland/config/cfg-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -3460,14 +3483,54 @@
"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",
"settings": {
"expand": false,
"order": [
":populated_places",
":comprehensive_places"
":comprehensive_places",
":buildings"
],
"show": false
}
Expand Down
24 changes: 24 additions & 0 deletions qgreenland/config/datasets/asiaq_nunagis.py
Original file line number Diff line number Diff line change
@@ -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",
},
},
)
1 change: 1 addition & 0 deletions qgreenland/config/layers/Places/__settings__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
order=[
":populated_places",
":comprehensive_places",
":buildings",
],
)
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,
),
],
)

0 comments on commit a11a11b

Please sign in to comment.