diff --git a/CHANGELOG.md b/CHANGELOG.md index 8464dbe8..0b79278d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ * QGreenland Custom is no longer supported. * Remove "Biology/Fish/Arctic Char" layer. +* Add "Geology/Tectonic plates" polygon layer. This layer accompanies the + existing "Geology/Tectonic plate boundaries" polyline layer from the same + dataset. * Fix descriptions of "Hydrology" outlets and basins layers. diff --git a/qgreenland/ancillary/styles/tectonic_plate_polygons.qml b/qgreenland/ancillary/styles/tectonic_plate_polygons.qml new file mode 100644 index 00000000..3941f172 --- /dev/null +++ b/qgreenland/ancillary/styles/tectonic_plate_polygons.qml @@ -0,0 +1,468 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 0.6 + 2 + diff --git a/qgreenland/config/cfg-lock.json b/qgreenland/config/cfg-lock.json index b848b90f..487b22a8 100644 --- a/qgreenland/config/cfg-lock.json +++ b/qgreenland/config/cfg-lock.json @@ -12658,6 +12658,59 @@ }, "name": "tectonic_plate_boundaries" }, + { + "layer_cfg": { + "description": "Polygons representing tectonic plates.", + "id": "tectonic_plate_polygons", + "in_package": true, + "input": { + "asset": { + "id": "only" + }, + "dataset": { + "id": "tectonic_plates" + } + }, + "show": false, + "steps": [ + { + "args": [ + "unzip", + "{input_dir}/tectonicplates-339b0c56563c118307b1f4542703047f5f698fae.zip", + "-d", + "{output_dir}", + "tectonicplates-339b0c56563c118307b1f4542703047f5f698fae/PB2002_plates.*" + ], + "type": "command" + }, + { + "args": [ + "ogr2ogr", + "-lco", + "ENCODING=UTF-8", + "-t_srs", + "EPSG:3413", + "-clipdst", + "{assets_dir}/latitude_shape_40_degrees.geojson", + "-makevalid", + "-nlt", + "MULTIPOLYGON", + "-dialect", + "sqlite", + "-sql", + "\"SELECT * FROM PB2002_plates where PlateName != 'Antarctica'\"", + "{output_dir}/final.gpkg", + "{input_dir}/tectonicplates-339b0c56563c118307b1f4542703047f5f698fae/*.shp" + ], + "type": "command" + } + ], + "style": "tectonic_plate_polygons", + "tags": [], + "title": "Tectonic plates" + }, + "name": "tectonic_plate_polygons" + }, { "layer_cfg": { "description": "Polygons representing dominant soil characteristics with percentage\npolygon area for each soil type. Data coverage limited to Greenland.", @@ -12867,6 +12920,7 @@ "order": [ ":earthquakes", ":tectonic_plate_boundaries", + ":tectonic_plate_polygons", ":soil_types", "Geological map" ], diff --git a/qgreenland/config/layers/Geology/__settings__.py b/qgreenland/config/layers/Geology/__settings__.py index 0e92eaec..47960b4f 100644 --- a/qgreenland/config/layers/Geology/__settings__.py +++ b/qgreenland/config/layers/Geology/__settings__.py @@ -4,6 +4,7 @@ order=[ ":earthquakes", ":tectonic_plate_boundaries", + ":tectonic_plate_polygons", ":soil_types", "Geological map", ], diff --git a/qgreenland/config/layers/Geology/tectonic_plates.py b/qgreenland/config/layers/Geology/tectonic_plates.py index 261c833a..4311ba4b 100644 --- a/qgreenland/config/layers/Geology/tectonic_plates.py +++ b/qgreenland/config/layers/Geology/tectonic_plates.py @@ -28,3 +28,42 @@ ), ], ) + + +tectonic_plate_polygons = Layer( + id="tectonic_plate_polygons", + title="Tectonic plates", + description=("""Polygons representing tectonic plates."""), + tags=[], + style="tectonic_plate_polygons", + input=LayerInput( + dataset=dataset, + asset=dataset.assets["only"], + ), + steps=[ + *compressed_vector( + input_file="{input_dir}/" + f"{FN}.zip", + output_file="{output_dir}/final.gpkg", + ogr2ogr_args=( + "-nlt", + "MULTIPOLYGON", + # Use SQL to exclude Antarctica. Without this exclusion, + # Antarctica gets included in the output, despite being clipped + # to the background boundary. We think this has something to do + # with reprojection causing verticies of Antarctica to be + # outside of the project projection's valid coordinate space + # (the edge where the polygon meets the dateline extends into + # infinity). + "-dialect", + "sqlite", + "-sql", + "\"SELECT * FROM PB2002_plates where PlateName != 'Antarctica'\"", + ), + boundary_filepath=project.boundaries["background"].filepath, + decompress_step_kwargs={ + "decompress_contents_mask": f"{FN}/PB2002_plates.*", + }, + vector_filename=f"{FN}/*.shp", + ), + ], +)