From 90cf7e46fc91babe11f00b8345fa24c01acf421d Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:01:10 -0600 Subject: [PATCH 1/7] Init config for arctic vegetation map --- .../ancillary/styles/arctic_vegetation.qml | 175 ++++++++++++++++++ .../circumpolar_arctic_vegetation_map.py | 81 ++++++++ .../Biology/Vegetation/vegetation_map.py | 82 ++++++++ 3 files changed, 338 insertions(+) create mode 100644 qgreenland/ancillary/styles/arctic_vegetation.qml create mode 100644 qgreenland/config/datasets/circumpolar_arctic_vegetation_map.py create mode 100644 qgreenland/config/layers/Biology/Vegetation/vegetation_map.py diff --git a/qgreenland/ancillary/styles/arctic_vegetation.qml b/qgreenland/ancillary/styles/arctic_vegetation.qml new file mode 100644 index 00000000..44822356 --- /dev/null +++ b/qgreenland/ancillary/styles/arctic_vegetation.qml @@ -0,0 +1,175 @@ + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + resamplingFilter + + 0 + diff --git a/qgreenland/config/datasets/circumpolar_arctic_vegetation_map.py b/qgreenland/config/datasets/circumpolar_arctic_vegetation_map.py new file mode 100644 index 00000000..d5507e53 --- /dev/null +++ b/qgreenland/config/datasets/circumpolar_arctic_vegetation_map.py @@ -0,0 +1,81 @@ +from qgreenland.models.config.asset import HttpAsset +from qgreenland.models.config.dataset import Dataset + +circumpolar_arctic_vegetation_map = Dataset( + id="circumpolar_arctic_vegetation_map", + assets=[ + HttpAsset( + id="only", + urls=[ + ( + "https://data.mendeley.com/public-files/datasets/c4xj5rv6kv/files/5223c414-234a-498c-ae08-3100cb38510f/file_downloaded" + ), + ], + ), + ], + metadata={ + "title": "Raster Circumpolar Arctic Vegetation Map", + "abstract": ( + """Land cover maps are the basic data layer required for + understanding and modeling ecological patterns and processes. The + Circumpolar Arctic Vegetation Map (CAVM), produced in 2003, has been + widely used as a base map for studies in the arctic tundra + biome. However, the relatively coarse resolution and vector format + of the map were not compatible with many other data sets. We present + a new version of the CAVM, building on the strengths of the original + map, while providing a finer spatial resolution, raster format, and + improved mapping. The Raster CAVM uses the legend, extent and + projection of the original CAVM. The legend has 16 vegetation types, + glacier, saline water, freshwater, and non-arctic land. The Raster + CAVM divides the original rock-water-vegetation complex map unit + that mapped the Canadian Shield into two map units, distinguishing + between areas with lichen- and shrub-dominated vegetation. In + contrast to the original hand-drawn CAVM, the new map is based on + unsupervised classifications of seventeen geographic/floristic + sub-sections of the Arctic, using AVHRR and MODIS data (reflectance + and NDVI) and elevation data. The units resulting from the + classification were modeled to the CAVM types using a wide variety + of ancillary data. The map was reviewed by experts familiar with + their particular region, including many of the original authors of + the CAVM from Canada, Greenland (Denmark), Iceland, Norway + (including Svalbard), Russia, and the U.S. The analysis presented + here summarizes the area, geographical distribution, elevation, + summer temperatures, and NDVI of the map units. The greater spatial + resolution of the Raster CAVM allowed more detailed mapping of + water-bodies and mountainous areas. It portrays coastal-inland + gradients, and better reflects the heterogeneity of vegetation type + distribution than the original CAVM. Accuracy assessment of random + 1-km pixels interpreted from 6 Landsat scenes showed an average of + 70 % accuracy, up from 39 % for the original CAVM. The distribution + of shrub-dominated types changed the most, with more prostrate shrub + tundra mapped in mountainous areas, and less low shrub tundra in + lowland areas. This improved mapping is important for quantifying + existing and potential changes to land cover, a key environmental + indicator for modeling and monitoring ecosystems. + + Related Publication: + + Martha K. Raynolds, Donald A. Walker, Andrew Balser, Christian Bay, + Mitch Campbell, Mikhail M. Cherosov, Fred J.A. Daniëls, Pernille + Bronken Eidesen, Ksenia A. Ermokhina, Gerald V. Frost, Birgit + Jedrzejek, M. Torre Jorgenson, Blair E. Kennedy, Sergei S. Kholod, + Igor A. Lavrinenko, Olga V. Lavrinenko, Borgþór Magnússon, Nadezhda + V. Matveyeva, Sigmar Metúsalemsson, Lennart Nilsen, Ian Olthof, Igor + N. Pospelov, Elena B. Pospelova, Darren Pouliot, Vladimir Razzhivin, + Gabriela Schaepman-Strub, Jozef Šibík, Mikhail Yu. Telyatnikov, + Elena Troeva, A raster version of the Circumpolar Arctic Vegetation + Map (CAVM), Remote Sensing of Environment, Volume 232, 2019, 111297, + ISSN 0034-4257, + https://doi.org/10.1016/j.rse.2019.111297. (https://www.sciencedirect.com/science/article/pii/S0034425719303165). + """ + ), + "citation": { + "text": ( + """Raynolds, Martha; Walker, Donald (2022), 'Raster Circumpolar + Arctic Vegetation Map', Mendeley Data, V2, doi: + 10.17632/c4xj5rv6kv.2""" + ), + "url": "https://data.mendeley.com/datasets/c4xj5rv6kv/2", + }, + }, +) diff --git a/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py new file mode 100644 index 00000000..8813778d --- /dev/null +++ b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py @@ -0,0 +1,82 @@ +from qgreenland.config.datasets.circumpolar_arctic_vegetation_map import ( + circumpolar_arctic_vegetation_map as dataset, +) +from qgreenland.config.helpers.steps.compress_and_add_overviews import ( + compress_and_add_overviews, +) +from qgreenland.config.helpers.steps.decompress import decompress_step +from qgreenland.config.helpers.steps.warp import warp +from qgreenland.config.project import project +from qgreenland.models.config.layer import Layer, LayerInput + +circumpolar_arctic_vegetation_map_layer = Layer( + id="circumpolar_arctic_vegetation_map", + title="Vegetation classification map (1km)", + description=( + """Arctic vegetation classification raster. + + Individual raster values are mapped to vegetation types as follows: + + 'Raster Code': 'Vegetation Unit' - 'Short Description' + 1: B1 - Cryptogam, herb barren + 2: B2a - Cryptogam, barren complex + 3: B3 - Non-carbonate mountain complex + 4: B4 - Carbonate mountain complex + 5: B2b - Cryptogam, barren, dwarf-shrub complex + 21: G1 - Graminoid, forb, cryptogam tundra + 22: G2 - Graminoid, prostrate dwarf-shrub, forb, moss tundra + 23: G3 - Non-tussock sedge, dwarf-shrub, moss tundra + 24: G4 - Tussock-sedge, dwarf-shrub, moss tundra + 31: P1 - Prostrate dwarf-shrub, herb, lichen tundra + 32: P2 - Prostrate/hemi-prostrate dwarf-shrub, lichen tundra + 33: S1 - Erect dwarf-shrub, moss tundra + 34: S2 - Low-shrub, moss tundra + 41: W1 - Sedge/grass, moss wetland complex + 42: W2 - Sedge, moss, dwarf-shrub wetland complex + 43: W3 - Sedge, moss, low-shrub wetland complex + 91: FW - Fresh water + 92: SW - Saline water + 93: GL - Glacier + 99: NA - Non-Arctic + + Environmental and climatic conditions are + extreme, with a short growing season and low summer temperatures. The + region support plants such as dwarf shrubs, herbs, lichens and mosses, + which grow close to the ground. As one moves southward (outward from + map's center in all directions), the amount of warmth available for + plant growth increases considerably, allowing the size, abundance, and + variety of plants to increase as well. Climate and other environmental + controls, such as landscape, topography, soil chemistry, soil moisture, + and the available plants that historically colonized an area, also + influence the distribution of plant communities. + + For more information, visit: + https://www.geobotany.uaf.edu/cavm/abstract.php.""" + ), + tags=[], + style="arctic_vegetation", + input=LayerInput( + dataset=dataset, + asset=dataset.assets["only"], + ), + steps=[ + decompress_step( + input_file="{input_dir}/Raster\\ CAVM\\ GIS\\ data.zip", + ), + *warp( + input_file="{input_dir}/raster_cavm_v1.tif", + output_file="{output_dir}/warped.tif", + cut_file=project.boundaries["background"].filepath, + warp_args=( + "-tr", + "1000", + "1000", + ), + ), + *compress_and_add_overviews( + input_file="{input_dir}/warped.tif", + output_file="{output_dir}/compressed.tif", + dtype_is_float=False, + ), + ], +) From 0a492bbd5cc0544e405445b188ee1937519a64aa Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:24:56 -0600 Subject: [PATCH 2/7] update config lockfile --- qgreenland/config/cfg-lock.json | 103 ++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index e1c74c8b..c4966dc0 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -237,6 +237,26 @@ "title": "The distribution of thick-billed and common murre colonies in the North." } }, + "circumpolar_arctic_vegetation_map": { + "assets": { + "only": { + "id": "only", + "urls": [ + "https://data.mendeley.com/public-files/datasets/c4xj5rv6kv/files/5223c414-234a-498c-ae08-3100cb38510f/file_downloaded" + ], + "verify_tls": true + } + }, + "id": "circumpolar_arctic_vegetation_map", + "metadata": { + "abstract": "Land cover maps are the basic data layer required for\nunderstanding and modeling ecological patterns and processes. The\nCircumpolar Arctic Vegetation Map (CAVM), produced in 2003, has been\nwidely used as a base map for studies in the arctic tundra\nbiome. However, the relatively coarse resolution and vector format\nof the map were not compatible with many other data sets. We present\na new version of the CAVM, building on the strengths of the original\nmap, while providing a finer spatial resolution, raster format, and\nimproved mapping. The Raster CAVM uses the legend, extent and\nprojection of the original CAVM. The legend has 16 vegetation types,\nglacier, saline water, freshwater, and non-arctic land. The Raster\nCAVM divides the original rock-water-vegetation complex map unit\nthat mapped the Canadian Shield into two map units, distinguishing\nbetween areas with lichen- and shrub-dominated vegetation. In\ncontrast to the original hand-drawn CAVM, the new map is based on\nunsupervised classifications of seventeen geographic/floristic\nsub-sections of the Arctic, using AVHRR and MODIS data (reflectance\nand NDVI) and elevation data. The units resulting from the\nclassification were modeled to the CAVM types using a wide variety\nof ancillary data. The map was reviewed by experts familiar with\ntheir particular region, including many of the original authors of\nthe CAVM from Canada, Greenland (Denmark), Iceland, Norway\n(including Svalbard), Russia, and the U.S. The analysis presented\nhere summarizes the area, geographical distribution, elevation,\nsummer temperatures, and NDVI of the map units. The greater spatial\nresolution of the Raster CAVM allowed more detailed mapping of\nwater-bodies and mountainous areas. It portrays coastal-inland\ngradients, and better reflects the heterogeneity of vegetation type\ndistribution than the original CAVM. Accuracy assessment of random\n1-km pixels interpreted from 6 Landsat scenes showed an average of\n70 % accuracy, up from 39 % for the original CAVM. The distribution\nof shrub-dominated types changed the most, with more prostrate shrub\ntundra mapped in mountainous areas, and less low shrub tundra in\nlowland areas. This improved mapping is important for quantifying\nexisting and potential changes to land cover, a key environmental\nindicator for modeling and monitoring ecosystems.\n\nRelated Publication:\n\nMartha K. Raynolds, Donald A. Walker, Andrew Balser, Christian Bay,\nMitch Campbell, Mikhail M. Cherosov, Fred J.A. Dani\u00ebls, Pernille\nBronken Eidesen, Ksenia A. Ermokhina, Gerald V. Frost, Birgit\nJedrzejek, M. Torre Jorgenson, Blair E. Kennedy, Sergei S. Kholod,\nIgor A. Lavrinenko, Olga V. Lavrinenko, Borg\u00fe\u00f3r Magn\u00fasson, Nadezhda\nV. Matveyeva, Sigmar Met\u00fasalemsson, Lennart Nilsen, Ian Olthof, Igor\nN. Pospelov, Elena B. Pospelova, Darren Pouliot, Vladimir Razzhivin,\nGabriela Schaepman-Strub, Jozef \u0160ib\u00edk, Mikhail Yu. Telyatnikov,\nElena Troeva, A raster version of the Circumpolar Arctic Vegetation\nMap (CAVM), Remote Sensing of Environment, Volume 232, 2019, 111297,\nISSN 0034-4257,\nhttps://doi.org/10.1016/j.rse.2019.111297. (https://www.sciencedirect.com/science/article/pii/S0034425719303165).", + "citation": { + "text": "Raynolds, Martha; Walker, Donald (2022), 'Raster Circumpolar\nArctic Vegetation Map', Mendeley Data, V2, doi:\n10.17632/c4xj5rv6kv.2", + "url": "https://data.mendeley.com/datasets/c4xj5rv6kv/2" + }, + "title": "Raster Circumpolar Arctic Vegetation Map" + } + }, "continental_shelf": { "assets": { "north_lines": { @@ -4258,6 +4278,89 @@ "title": "Vegetation biomass 2010 (12.4km)" }, "name": "vegetation_biomass_2010" + }, + { + "layer_cfg": { + "description": "Arctic vegetation classification raster.\n\nIndividual raster values are mapped to vegetation types as follows:\n\n'Raster Code': 'Vegetation Unit' - 'Short Description'\n1: B1 - Cryptogam, herb barren\n2: B2a - Cryptogam, barren complex\n3: B3 - Non-carbonate mountain complex\n4: B4 - Carbonate mountain complex\n5: B2b - Cryptogam, barren, dwarf-shrub complex\n21: G1 - Graminoid, forb, cryptogam tundra\n22: G2 - Graminoid, prostrate dwarf-shrub, forb, moss tundra\n23: G3 - Non-tussock sedge, dwarf-shrub, moss tundra\n24: G4 - Tussock-sedge, dwarf-shrub, moss tundra\n31: P1 - Prostrate dwarf-shrub, herb, lichen tundra\n32: P2 - Prostrate/hemi-prostrate dwarf-shrub, lichen tundra\n33: S1 - Erect dwarf-shrub, moss tundra\n34: S2 - Low-shrub, moss tundra\n41: W1 - Sedge/grass, moss wetland complex\n42: W2 - Sedge, moss, dwarf-shrub wetland complex\n43: W3 - Sedge, moss, low-shrub wetland complex\n91: FW - Fresh water\n92: SW - Saline water\n93: GL - Glacier\n99: NA - Non-Arctic\n\n Environmental and climatic conditions are\nextreme, with a short growing season and low summer temperatures. The\nregion support plants such as dwarf shrubs, herbs, lichens and mosses,\nwhich grow close to the ground. As one moves southward (outward from\nmap's center in all directions), the amount of warmth available for\nplant growth increases considerably, allowing the size, abundance, and\nvariety of plants to increase as well. Climate and other environmental\ncontrols, such as landscape, topography, soil chemistry, soil moisture,\nand the available plants that historically colonized an area, also\ninfluence the distribution of plant communities.\n\nFor more information, visit:\nhttps://www.geobotany.uaf.edu/cavm/abstract.php.", + "id": "circumpolar_arctic_vegetation_map", + "in_package": true, + "input": { + "asset": { + "id": "only" + }, + "dataset": { + "id": "circumpolar_arctic_vegetation_map" + } + }, + "show": false, + "steps": [ + { + "args": [ + "unzip", + "{input_dir}/Raster\\ CAVM\\ GIS\\ data.zip", + "-d", + "{output_dir}", + "" + ], + "type": "command" + }, + { + "args": [ + "gdalwarp", + "-cutline", + "{assets_dir}/latitude_shape_40_degrees.geojson", + "-crop_to_cutline", + "-r", + "bilinear", + "-t_srs", + "EPSG:3413", + "-tr", + "1000", + "1000", + "-co", + "COMPRESS=DEFLATE", + "{input_dir}/raster_cavm_v1.tif", + "{output_dir}/warped.tif" + ], + "type": "command" + }, + { + "args": [ + "gdal_translate", + "-co", + "TILED=YES", + "-co", + "COMPRESS=DEFLATE", + "-co", + "PREDICTOR=2", + "{input_dir}/warped.tif", + "{output_dir}/compressed.tif" + ], + "type": "command" + }, + { + "args": [ + "cp", + "{input_dir}/compressed.tif", + "{output_dir}/compressed.tif", + "&&", + "gdaladdo", + "-r", + "average", + "{output_dir}/compressed.tif", + "2", + "4", + "8", + "16" + ], + "type": "command" + } + ], + "style": "arctic_vegetation", + "tags": [], + "title": "Vegetation classification map (1km)" + }, + "name": "circumpolar_arctic_vegetation_map" } ], "name": "Vegetation", From 7e3ce55dc5eb545c3d89fa37b450e6fce4009a78 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:26:28 -0600 Subject: [PATCH 3/7] Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f60fe24..ebfc0769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,9 @@ stations", "GC-Net automated weather stations") with one layer ("PROMICE and GC-Net automated weather stations") from a more up-to-date dataset provided by GEUS. +- Add new "Biology/Vegetation/Vegetation classification map (1km)" layer from + the Raster Circumpolar Arctic Vegetation Map produced by Raynolds et al., + 2019. # v3.0.0alpha2 (2023-05-09) From e393103f18981a8dee51295fa828558845ede963 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:31:51 -0600 Subject: [PATCH 4/7] Tweak resampling method This is categorical data, so 'nearest' should be used. --- qgreenland/config/layers/Biology/Vegetation/vegetation_map.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py index 8813778d..08fa4446 100644 --- a/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py +++ b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py @@ -67,6 +67,7 @@ input_file="{input_dir}/raster_cavm_v1.tif", output_file="{output_dir}/warped.tif", cut_file=project.boundaries["background"].filepath, + resampling_method="nearest", warp_args=( "-tr", "1000", From d80c377a44e1ae1700f96f7d83b19ee72838962f Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:35:15 -0600 Subject: [PATCH 5/7] config lockfile --- qgreenland/config/cfg-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index c4966dc0..6ae5b879 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -4311,7 +4311,7 @@ "{assets_dir}/latitude_shape_40_degrees.geojson", "-crop_to_cutline", "-r", - "bilinear", + "nearest", "-t_srs", "EPSG:3413", "-tr", From 07cc2f77ed7ee9b65a3e969c2e85b8ca5bcc50fc Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:54:23 -0600 Subject: [PATCH 6/7] tweak resampling alg for creating overviews --- qgreenland/config/layers/Biology/Vegetation/vegetation_map.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py index 08fa4446..c01e6f63 100644 --- a/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py +++ b/qgreenland/config/layers/Biology/Vegetation/vegetation_map.py @@ -77,6 +77,7 @@ *compress_and_add_overviews( input_file="{input_dir}/warped.tif", output_file="{output_dir}/compressed.tif", + resampling_algorithm="mode", dtype_is_float=False, ), ], From b96aaf6cbb3e2f60e6d1f0fc2b24b6120e154334 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Wed, 28 Jun 2023 14:59:11 -0600 Subject: [PATCH 7/7] Config lockfile :bell: --- qgreenland/config/cfg-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index 6ae5b879..5571cada 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -4346,7 +4346,7 @@ "&&", "gdaladdo", "-r", - "average", + "mode", "{output_dir}/compressed.tif", "2", "4",