Skip to content

Commit

Permalink
Add online-only Arctic DEM layer
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Aug 30, 2023
1 parent 0d710d9 commit 5296cb6
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 215 deletions.
2 changes: 1 addition & 1 deletion qgreenland/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Literal, Union

VectorOrRaster = Literal["Vector", "Raster"]
QgsLayerProviderType = Literal["gdal", "ogr", "wms", "wfs", "wcs"]
QgsLayerProviderType = Literal["gdal", "ogr", "wms", "wfs", "wcs", "arcgismapserver"]

ResamplingMethod = Literal["bilinear", "nearest"]

Expand Down
158 changes: 37 additions & 121 deletions qgreenland/config/cfg-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,22 @@
"title": "Arctic Circle (66\u00b0 34' North)"
}
},
"arctic_dem": {
"arctic_dem_online_v4_1": {
"assets": {
"100m": {
"id": "100m",
"urls": [
"https://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/100m/arcticdem_mosaic_100m_v3.0.tif"
],
"verify_tls": false
},
"1km": {
"id": "1km",
"urls": [
"http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/1km/arcticdem_mosaic_1km_v3.0.tif"
],
"verify_tls": true
},
"500m": {
"id": "500m",
"urls": [
"http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/500m/arcticdem_mosaic_500m_v3.0.tif"
],
"verify_tls": true
"only": {
"id": "only",
"provider": "arcgismapserver",
"url": "crs='EPSG:3413' crs='EPSG:3413' format='' layer='' url='https://overlord.pgc.umn.edu/arcgis/rest/services/elevation/pgc_arcticdem_mosaics_latest/ImageServer'"
}
},
"id": "arctic_dem",
"id": "arctic_dem_online_v4_1",
"metadata": {
"abstract": "ArcticDEM is an NGA-NSF public-private initiative to\nautomatically produce a high-resolution, high quality, digital\nsurface model (DSM) of the Arctic using optical stereo imagery,\nhigh-performance computing, and open source photogrammetry\nsoftware.",
"citation": {
"text": "Data provided by the Polar Geospatial Center. Porter, Claire;\nMorin, Paul; Howat, Ian; Noh, Myoung-Jon; Bates, Brian;\nPeterman, Kenneth; Keesey, Scott; Schlenk, Matthew; Gardiner,\nJudith; Tomko, Karen; Willis, Michael; Kelleher, Cole; Cloutier,\nMichael; Husby, Eric; Foga, Steven; Nakamura, Hitomi; Platson,\nMelisa; Wethington, Michael, Jr.; Williamson, Cathleen; Bauer,\nGregory; Enos, Jeremy; Arnold, Galen; Kramer, William; Becker,\nPeter; Doshi, Abhijit; D\u2019Souza, Cristelle; Cummens, Pat;\nLaurier, Fabien; Bojesen, Mikkel, 2018, \u201cArcticDEM\u201d,\nhttps://doi.org/10.7910/DVN/OHHUKH, Harvard Dataverse, V1,\n2020-01-23",
"text": "Porter, C., Howat, I., Noh, M.J., Husby, E., Khuvis, S.,\nDanish, E., Tomko, K., Gardiner, J., Negrete, A., Yadav, B., Klassen, J.,\nKelleher, C., Cloutier, M., Bakker, J., Enos, J., Arnold, G., Bauer, G., and\nMorin, P., 2023, \"ArcticDEM - Mosaics, Version 4.1\",\nhttps://doi.org/10.7910/DVN/3VDC4W",
"url": "https://www.pgc.umn.edu/data/arcticdem/"
},
"title": "Arctic DEM (1km mosaic)"
"title": "Arctic DEM"
}
},
"arctic_vegetation_biomass_2010": {
Expand Down Expand Up @@ -27191,111 +27175,43 @@
}
},
{
"layer_cfg": {
"description": "Surface elevation in meters using hillshade symbology.",
"id": "arctic_dem",
"in_package": false,
"input": {
"asset": {
"id": "100m"
},
"dataset": {
"id": "arctic_dem"
}
},
"show": false,
"steps": [
{
"args": [
"gdalwarp",
"-cutline",
"{assets_dir}/greenland_rectangle.geojson",
"-crop_to_cutline",
"-r",
"bilinear",
"-t_srs",
"EPSG:3413",
"-co",
"COMPRESS=DEFLATE",
"{input_dir}/arcticdem_mosaic_100m_v3.0.tif",
"{output_dir}/arctic_dem.tif"
],
"type": "command"
},
{
"args": [
"gdal_calc.py",
"--calc",
"\"A * 100.0\"",
"--NoDataValue",
"-9999",
"--type",
"Int32",
"-A",
"{input_dir}/arctic_dem.tif",
"--outfile",
"{output_dir}/arctic_dem_scaled.tif"
],
"type": "command"
},
{
"args": [
"cp",
"{input_dir}/arctic_dem_scaled.tif",
"{output_dir}/arctic_dem.tif",
"&&",
"gdal_edit.py",
"-scale",
"0.01",
"{output_dir}/arctic_dem.tif"
],
"type": "command"
},
{
"args": [
"gdal_translate",
"-co",
"TILED=YES",
"-co",
"COMPRESS=DEFLATE",
"-co",
"PREDICTOR=2",
"{input_dir}/arctic_dem.tif",
"{output_dir}/compressed.tif"
],
"type": "command"
"children": [
{
"layer_cfg": {
"description": "Surface elevation in meters.",
"id": "arctic_dem",
"in_package": true,
"input": {
"asset": {
"id": "only"
},
"dataset": {
"id": "arctic_dem_online_v4_1"
}
},
"show": false,
"steps": null,
"style": null,
"tags": [],
"title": "Arctic DEM"
},
{
"args": [
"cp",
"{input_dir}/compressed.tif",
"{output_dir}/arctic_dem.tif",
"&&",
"gdaladdo",
"-r",
"average",
"{output_dir}/arctic_dem.tif",
"2",
"4",
"8",
"16"
],
"type": "command"
}
],
"style": "arctic_dem",
"tags": [],
"title": "Arctic DEM (100m)"
},
"name": "arctic_dem"
"name": "arctic_dem"
}
],
"name": "Internet required",
"settings": {
"expand": false,
"order": null,
"show": false
}
}
],
"name": "Terrain models",
"settings": {
"expand": false,
"order": [
"BedMachine v5",
":arctic_dem"
"Internet required"
],
"show": false
}
Expand Down
51 changes: 17 additions & 34 deletions qgreenland/config/datasets/arctic_dem.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
from qgreenland.models.config.asset import HttpAsset
from qgreenland.models.config.asset import OnlineAsset
from qgreenland.models.config.dataset import Dataset

arctic_dem = Dataset(
id="arctic_dem",
arctic_dem_online_v4_1 = Dataset(
id="arctic_dem_online_v4_1",
assets=[
HttpAsset(
id="1km",
urls=[
"http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/1km/arcticdem_mosaic_1km_v3.0.tif",
],
),
HttpAsset(
id="500m",
urls=[
"http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/500m/arcticdem_mosaic_500m_v3.0.tif",
],
),
HttpAsset(
id="100m",
# This shouldn't be necessary?
verify_tls=False,
urls=[
"https://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v3.0/100m/arcticdem_mosaic_100m_v3.0.tif",
],
OnlineAsset(
id="only",
provider="arcgismapserver",
url=(
"crs='EPSG:3413' crs='EPSG:3413' format='' layer='' "
"url='https://overlord.pgc.umn.edu/arcgis/rest/services/elevation/"
"pgc_arcticdem_mosaics_latest/ImageServer'"
),
),
],
metadata={
"title": "Arctic DEM (1km mosaic)",
"title": "Arctic DEM",
"abstract": (
"""ArcticDEM is an NGA-NSF public-private initiative to
automatically produce a high-resolution, high quality, digital
Expand All @@ -36,17 +25,11 @@
),
"citation": {
"text": (
"""Data provided by the Polar Geospatial Center. Porter, Claire;
Morin, Paul; Howat, Ian; Noh, Myoung-Jon; Bates, Brian;
Peterman, Kenneth; Keesey, Scott; Schlenk, Matthew; Gardiner,
Judith; Tomko, Karen; Willis, Michael; Kelleher, Cole; Cloutier,
Michael; Husby, Eric; Foga, Steven; Nakamura, Hitomi; Platson,
Melisa; Wethington, Michael, Jr.; Williamson, Cathleen; Bauer,
Gregory; Enos, Jeremy; Arnold, Galen; Kramer, William; Becker,
Peter; Doshi, Abhijit; D’Souza, Cristelle; Cummens, Pat;
Laurier, Fabien; Bojesen, Mikkel, 2018, “ArcticDEM”,
https://doi.org/10.7910/DVN/OHHUKH, Harvard Dataverse, V1,
2020-01-23"""
"""Porter, C., Howat, I., Noh, M.J., Husby, E., Khuvis, S.,
Danish, E., Tomko, K., Gardiner, J., Negrete, A., Yadav, B., Klassen, J.,
Kelleher, C., Cloutier, M., Bakker, J., Enos, J., Arnold, G., Bauer, G., and
Morin, P., 2023, "ArcticDEM - Mosaics, Version 4.1",
https://doi.org/10.7910/DVN/3VDC4W"""
),
"url": "https://www.pgc.umn.edu/data/arcticdem/",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from qgreenland.config.datasets.arctic_dem import arctic_dem_online_v4_1 as dataset
from qgreenland.models.config.layer import Layer, LayerInput

arctic_dem_online = Layer(
id="arctic_dem",
title="Arctic DEM",
description="Surface elevation in meters.",
in_package=True,
tags=[],
input=LayerInput(
dataset=dataset,
asset=dataset.assets["only"],
),
)
3 changes: 1 addition & 2 deletions qgreenland/config/layers/Terrain models/__settings__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from qgreenland.models.config.layer_group import (
LayerGroupIdentifier,
LayerGroupSettings,
LayerIdentifier,
)

settings = LayerGroupSettings(
order=[
LayerGroupIdentifier("BedMachine v5"),
LayerIdentifier("arctic_dem"),
LayerGroupIdentifier("Internet required"),
],
)
57 changes: 0 additions & 57 deletions qgreenland/config/layers/Terrain models/arctic_dem.py

This file was deleted.

1 change: 1 addition & 0 deletions qgreenland/constants/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
"gdal": "Raster",
"wms": "Raster",
"wfs": "Vector",
"arcgismapserver": "Raster",
}

0 comments on commit 5296cb6

Please sign in to comment.