From 8a3b2592530d71769137a328c753667ded721320 Mon Sep 17 00:00:00 2001 From: Jeffrey Vervoort Date: Fri, 1 Mar 2024 10:47:41 +0100 Subject: [PATCH] Add happy path test for the EDR GeoJSON feature collection. --- .../edr-geojson-feature-collection.json | 88 +++++++++++++++++++ tests/test_edr.py | 2 + 2 files changed, 90 insertions(+) create mode 100644 tests/test_data/edr-geojson-feature-collection.json diff --git a/tests/test_data/edr-geojson-feature-collection.json b/tests/test_data/edr-geojson-feature-collection.json new file mode 100644 index 0000000..aeb6bbc --- /dev/null +++ b/tests/test_data/edr-geojson-feature-collection.json @@ -0,0 +1,88 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 5.1797, + 52.0989, + 1.9 + ] + }, + "properties": { + "name": "DE BILT AWS", + "parameter-name": [ + "air_temperature_1.5_maximum_PT10M", + "dew_point_temperature_1.5_mean_PT1M", + "duration_of_sunshine_2.0_point_PT0S", + "wind_speed_10_mean_PT10M" + ] + }, + "id": "06260" + } + ], + "parameters": { + "tx_dryb_10": { + "type": "Parameter", + "description": "Temperature, air, maximum, 10", + "unit": { + "label": "degree Celsius", + "symbol": { + "value": "°C", + "type": "http://www.opengis.net/def/uom/UCUM/" + } + }, + "observedProperty": { + "id": "https://vocab.nerc.ac.uk/standard_name/air_temperature", + "label": "Air temperature maximum" + } + }, + "t_dewp_10": { + "type": "Parameter", + "description": "Temperature air dewpoint 10", + "unit": { + "label": "degree Celsius", + "symbol": { + "value": "°C", + "type": "http://www.opengis.net/def/uom/UCUM/" + } + }, + "observedProperty": { + "id": "https://vocab.nerc.ac.uk/standard_name/dew_point_temperature", + "label": "Dew Point Temperature" + } + }, + "sq_10": { + "type": "Parameter", + "description": "Sunshine duration, duration derived from radiation, 10", + "unit": { + "label": "minute", + "symbol": { + "value": "min", + "type": "http://www.opengis.net/def/uom/UCUM/" + } + }, + "observedProperty": { + "id": "https://vocab.nerc.ac.uk/standard_name/duration_of_sunshine", + "label": "Sunshine duration" + } + }, + "ff_10m_10": { + "type": "Parameter", + "description": "Wind, speed, average, converted to 10 metres, 10", + "unit": { + "label": "metre per second", + "symbol": { + "value": "m/s", + "type": "http://www.opengis.net/def/uom/UCUM/" + } + }, + "observedProperty": { + "id": "https://vocab.nerc.ac.uk/standard_name/wind_speed", + "label": "wind_speed_10_mean_PT10M" + } + } + } +} diff --git a/tests/test_edr.py b/tests/test_edr.py index 0376f71..cf06bd6 100644 --- a/tests/test_edr.py +++ b/tests/test_edr.py @@ -5,6 +5,7 @@ from edr_pydantic.capabilities import LandingPageModel from edr_pydantic.collections import Collections from edr_pydantic.collections import Instance +from edr_pydantic.edr_feature_collection import EDRFeatureCollection from edr_pydantic.unit import Unit from pydantic import ValidationError @@ -13,6 +14,7 @@ ("doc-example-collections.json", Collections), ("simple-instance.json", Instance), ("landing-page.json", LandingPageModel), + ("edr-geojson-feature-collection.json", EDRFeatureCollection), ]