diff --git a/CHANGELOG.md b/CHANGELOG.md index e02a5081..bee7099e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v3.1.0 (2023-08-31) + +- Add new "Terrain models/Internet required/Arctic DEM" layer. + # v3.0.0 (2023-08-24) - Switch to `.qgz` compressed project file. diff --git a/CITATION.cff b/CITATION.cff index 11157916..b449b278 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -22,8 +22,8 @@ keywords: url: "https://github.com/nsidc/qgreenland" repository-code: "https://github.com/nsidc/qgreenland" -version: "3.0.0" -date-released: "2023-08-24" +version: "3.1.0" +date-released: "2023-08-31" authors: - family-names: "*Fisher" diff --git a/VERSION.env b/VERSION.env index 7359a32f..4fde233f 100644 --- a/VERSION.env +++ b/VERSION.env @@ -1 +1 @@ -export QGREENLAND_VERSION="v3.0.0" +export QGREENLAND_VERSION="v3.1.0" diff --git a/doc/conf.py b/doc/conf.py index a25a4d6f..aa123f56 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,7 +26,7 @@ author = "National Snow and Ice Data Center" # The full version, including alpha/beta/rc tags -release = "v3.0.0" +release = "v3.1.0" # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index e9a20e0f..8032e9c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,7 @@ inline-quotes = "double" [tool.bumpversion] -current_version = "3.0.0" +current_version = "3.1.0" commit = false tag = false parse = """ diff --git a/qgreenland/__init__.py b/qgreenland/__init__.py index 5234c490..6d1c74fb 100644 --- a/qgreenland/__init__.py +++ b/qgreenland/__init__.py @@ -1 +1 @@ -__version__ = "v3.0.0" +__version__ = "v3.1.0" diff --git a/qgreenland/_typing.py b/qgreenland/_typing.py index f26810d5..10d33670 100644 --- a/qgreenland/_typing.py +++ b/qgreenland/_typing.py @@ -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"] diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index 4797d8df..a3289882 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -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": { @@ -27191,103 +27175,35 @@ } }, { - "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", @@ -27295,7 +27211,7 @@ "expand": false, "order": [ "BedMachine v5", - ":arctic_dem" + "Internet required" ], "show": false } diff --git a/qgreenland/config/datasets/arctic_dem.py b/qgreenland/config/datasets/arctic_dem.py index 2bc236c1..c2669bdf 100644 --- a/qgreenland/config/datasets/arctic_dem.py +++ b/qgreenland/config/datasets/arctic_dem.py @@ -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 @@ -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/", }, diff --git a/qgreenland/config/layers/Terrain models/Internet required/arctic_dem.py b/qgreenland/config/layers/Terrain models/Internet required/arctic_dem.py new file mode 100644 index 00000000..eead5300 --- /dev/null +++ b/qgreenland/config/layers/Terrain models/Internet required/arctic_dem.py @@ -0,0 +1,22 @@ +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. + +Note that the Polar Geospatial Center also provides custom download options for +a 32m ArcticDEM for QGreenland users. Learn about these add-on data for +QGreenland here: +https://qgreenland.readthedocs.io/en/latest/user/reference/addons/arctic-dem-addon-data.html +""" + ), + in_package=True, + tags=[], + input=LayerInput( + dataset=dataset, + asset=dataset.assets["only"], + ), +) diff --git a/qgreenland/config/layers/Terrain models/__settings__.py b/qgreenland/config/layers/Terrain models/__settings__.py index c5fad130..234e5709 100644 --- a/qgreenland/config/layers/Terrain models/__settings__.py +++ b/qgreenland/config/layers/Terrain models/__settings__.py @@ -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"), ], ) diff --git a/qgreenland/config/layers/Terrain models/arctic_dem.py b/qgreenland/config/layers/Terrain models/arctic_dem.py deleted file mode 100644 index 4ef6a89e..00000000 --- a/qgreenland/config/layers/Terrain models/arctic_dem.py +++ /dev/null @@ -1,57 +0,0 @@ -from qgreenland.config.datasets.arctic_dem import arctic_dem as dataset -from qgreenland.config.helpers.steps.compress_and_add_overviews import ( - compress_and_add_overviews, -) -from qgreenland.config.helpers.steps.gdal_edit import gdal_edit -from qgreenland.config.helpers.steps.warp import warp -from qgreenland.config.project import project -from qgreenland.models.config.layer import Layer, LayerInput -from qgreenland.models.config.step import CommandStep - -arctic_dem = Layer( - id="arctic_dem", - title="Arctic DEM (100m)", - description="Surface elevation in meters using hillshade symbology.", - in_package=False, - tags=[], - style="arctic_dem", - input=LayerInput( - dataset=dataset, - asset=dataset.assets["100m"], - ), - steps=[ - *warp( - input_file="{input_dir}/arcticdem_mosaic_100m_v3.0.tif", - output_file="{output_dir}/arctic_dem.tif", - cut_file=project.boundaries["data"].filepath, - ), - CommandStep( - 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", - ], - ), - *gdal_edit( - input_file="{input_dir}/arctic_dem_scaled.tif", - output_file="{output_dir}/arctic_dem.tif", - gdal_edit_args=[ - "-scale", - "0.01", - ], - ), - *compress_and_add_overviews( - input_file="{input_dir}/arctic_dem.tif", - output_file="{output_dir}/arctic_dem.tif", - dtype_is_float=False, - ), - ], -) diff --git a/qgreenland/constants/misc.py b/qgreenland/constants/misc.py index a27e907e..b7949ab1 100644 --- a/qgreenland/constants/misc.py +++ b/qgreenland/constants/misc.py @@ -4,4 +4,5 @@ "gdal": "Raster", "wms": "Raster", "wfs": "Vector", + "arcgismapserver": "Raster", }