Skip to content

Commit

Permalink
Add GTN-P reference layers: CALM and TSP sites
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Jul 19, 2023
1 parent 571d936 commit 508c0b6
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 4 deletions.
39 changes: 39 additions & 0 deletions qgreenland/config/datasets/gtn_permafrost.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from qgreenland.models.config.asset import HttpAsset
from qgreenland.models.config.dataset import Dataset

gtn_permafrost = Dataset(
id="gtn_permafrost",
assets=[
HttpAsset(
id="boreholes",
urls=[
"http://flatey.arcticportal.org:8080/geoserver/page21/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=page21:tsp&maxFeatures=3000&outputFormat=CSV",
],
),
HttpAsset(
id="calm_sites",
urls=[
"https://gtnp.arcticportal.org/images/downloads/calm.csv",
],
),
],
metadata={
"title": "Global Terrestrial Network for Permafrost (GTN-P)",
"abstract": (
"""The Global Terrestrial Network for Permafrost (GTN-P) is the
primary international programme concerned with monitoring permafrost
parameters. GTN-P was developed by the International Permafrost
Association (IPA) under the Global Climate Observing System (GCOS)
and the Global Terrestrial Observing Network (GTOS) in 1999, with
the long term goal of obtaining a comprehensive view of the spatial
structure, trends, and variability of changes in the active layer
thickness and permafrost temperature."""
),
"citation": {
"text": (
"""Global Terrestrial Network for Permafrost. Date accessed: {{date_accessed}}."""
),
"url": "https://gtnp.arcticportal.org/",
},
},
)
68 changes: 64 additions & 4 deletions qgreenland/config/layers/Frozen ground/layers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from qgreenland.config.datasets.gtn_permafrost import gtn_permafrost
from qgreenland.config.datasets.pangaea_ground_temperature import (
pangaea_ground_temperature as dataset,
pangaea_ground_temperature as pangaea_dataset,
)
from qgreenland.config.helpers.steps.compress_and_add_overviews import (
compress_and_add_overviews,
)
from qgreenland.config.helpers.steps.ogr2ogr import ogr2ogr
from qgreenland.config.helpers.steps.warp_and_cut import warp_and_cut
from qgreenland.config.project import project
from qgreenland.models.config.layer import Layer, LayerInput
Expand Down Expand Up @@ -36,16 +38,16 @@
}


layers = [
pangaea_layers = [
Layer(
id=layer_id,
title=params["title"],
description=params["description"],
tags=[],
style=params["style"],
input=LayerInput(
dataset=dataset,
asset=dataset.assets["10km"],
dataset=pangaea_dataset,
asset=pangaea_dataset.assets["10km"],
),
steps=[
*warp_and_cut(
Expand Down Expand Up @@ -85,3 +87,61 @@
)
for layer_id, params in _layer_params.items()
]

gtn_permafrost_layers = [
Layer(
id=layer_id,
title=params["title"],
description=params["description"],
tags=[],
style=params["style"],
input=LayerInput(
dataset=gtn_permafrost,
asset=gtn_permafrost.assets[params["asset"]],
),
steps=[
*ogr2ogr(
input_file="{input_dir}/*.csv",
output_file="{output_dir}/final.gpkg",
ogr2ogr_args=(
"-s_srs",
"EPSG:4326",
# The geometry is encoded as a WKT `Point`
"-oo",
"GEOM_POSSIBLE_NAMES=geom_ref",
"-oo",
"AUTODETECT_TYPE=YES",
*params["ogr2ogr_args"],
),
),
],
)
for layer_id, params in {
"boreholes": {
"title": "Thermal State of Permafrost (TSP) monitoring sites",
"description": (
"""The maps of boreholes display the location of all
Thermal State of Permafrost (TSP) monitoring sites contained in
the GTN-P database.
"""
),
"style": None,
"asset": "boreholes",
"ogr2ogr_args": (),
},
"calm_sites": {
"title": "Active Layer Monitoring sites",
"description": "The maps of Circumpolar Active Layer Thickness Monitoring (CALM) sites display the location of all monitoring sites contained in the GTN-P database.",
"style": None,
"asset": "calm_sites",
"ogr2ogr_args": (
# Layer creation option: Use "ID" as a FID column instead of
# the existing "FID", which is a string. `ogr2ogr` complains
# that this is an invalid type for the FID column otherwise.
"-lco",
"FID=ID",
),
},
}.items()
]

0 comments on commit 508c0b6

Please sign in to comment.