diff --git a/STAC/data/current/shore_mon/changerate-mapbox/changerate-mapbox-value.json b/STAC/data/current/shore_mon/changerate-mapbox/changerate-mapbox-value.json index 79429bc1..e80bf6be 100644 --- a/STAC/data/current/shore_mon/changerate-mapbox/changerate-mapbox-value.json +++ b/STAC/data/current/shore_mon/changerate-mapbox/changerate-mapbox-value.json @@ -40,7 +40,7 @@ "deltares:type": "circle", "deltares:stations": "locationId", "deltares:onclick": {}, - "datetime": "2024-06-03T11:25:31.883235Z" + "datetime": "2024-06-19T08:28:16.036044Z" }, "geometry": { "type": "Polygon", diff --git a/STAC/data/current/shore_mon/collection.json b/STAC/data/current/shore_mon/collection.json index 40b90d40..fca5bde7 100644 --- a/STAC/data/current/shore_mon/collection.json +++ b/STAC/data/current/shore_mon/collection.json @@ -58,7 +58,104 @@ 179.667697861 ], "description": "Longitude", - "reference_system": "EPSG:4326", + "reference_system": { + "$schema": "https://proj.org/schemas/v0.7/projjson.schema.json", + "type": "GeographicCRS", + "name": "WGS 84", + "datum_ensemble": { + "name": "World Geodetic System 1984 ensemble", + "members": [ + { + "name": "World Geodetic System 1984 (Transit)", + "id": { + "authority": "EPSG", + "code": 1166 + } + }, + { + "name": "World Geodetic System 1984 (G730)", + "id": { + "authority": "EPSG", + "code": 1152 + } + }, + { + "name": "World Geodetic System 1984 (G873)", + "id": { + "authority": "EPSG", + "code": 1153 + } + }, + { + "name": "World Geodetic System 1984 (G1150)", + "id": { + "authority": "EPSG", + "code": 1154 + } + }, + { + "name": "World Geodetic System 1984 (G1674)", + "id": { + "authority": "EPSG", + "code": 1155 + } + }, + { + "name": "World Geodetic System 1984 (G1762)", + "id": { + "authority": "EPSG", + "code": 1156 + } + }, + { + "name": "World Geodetic System 1984 (G2139)", + "id": { + "authority": "EPSG", + "code": 1309 + } + } + ], + "ellipsoid": { + "name": "WGS 84", + "semi_major_axis": 6378137, + "inverse_flattening": 298.257223563 + }, + "accuracy": "2.0", + "id": { + "authority": "EPSG", + "code": 6326 + } + }, + "coordinate_system": { + "subtype": "ellipsoidal", + "axis": [ + { + "name": "Geodetic latitude", + "abbreviation": "Lat", + "direction": "north", + "unit": "degree" + }, + { + "name": "Geodetic longitude", + "abbreviation": "Lon", + "direction": "east", + "unit": "degree" + } + ] + }, + "scope": "Horizontal component of 3D system.", + "area": "World.", + "bbox": { + "south_latitude": -90, + "west_longitude": -180, + "north_latitude": 90, + "east_longitude": 180 + }, + "id": { + "authority": "EPSG", + "code": 4326 + } + }, "type": "spatial" }, "lat": { @@ -68,7 +165,104 @@ 66.4159042598 ], "description": "Latitude", - "reference_system": "EPSG:4326", + "reference_system": { + "$schema": "https://proj.org/schemas/v0.7/projjson.schema.json", + "type": "GeographicCRS", + "name": "WGS 84", + "datum_ensemble": { + "name": "World Geodetic System 1984 ensemble", + "members": [ + { + "name": "World Geodetic System 1984 (Transit)", + "id": { + "authority": "EPSG", + "code": 1166 + } + }, + { + "name": "World Geodetic System 1984 (G730)", + "id": { + "authority": "EPSG", + "code": 1152 + } + }, + { + "name": "World Geodetic System 1984 (G873)", + "id": { + "authority": "EPSG", + "code": 1153 + } + }, + { + "name": "World Geodetic System 1984 (G1150)", + "id": { + "authority": "EPSG", + "code": 1154 + } + }, + { + "name": "World Geodetic System 1984 (G1674)", + "id": { + "authority": "EPSG", + "code": 1155 + } + }, + { + "name": "World Geodetic System 1984 (G1762)", + "id": { + "authority": "EPSG", + "code": 1156 + } + }, + { + "name": "World Geodetic System 1984 (G2139)", + "id": { + "authority": "EPSG", + "code": 1309 + } + } + ], + "ellipsoid": { + "name": "WGS 84", + "semi_major_axis": 6378137, + "inverse_flattening": 298.257223563 + }, + "accuracy": "2.0", + "id": { + "authority": "EPSG", + "code": 6326 + } + }, + "coordinate_system": { + "subtype": "ellipsoidal", + "axis": [ + { + "name": "Geodetic latitude", + "abbreviation": "Lat", + "direction": "north", + "unit": "degree" + }, + { + "name": "Geodetic longitude", + "abbreviation": "Lon", + "direction": "east", + "unit": "degree" + } + ] + }, + "scope": "Horizontal component of 3D system.", + "area": "World.", + "bbox": { + "south_latitude": -90, + "west_longitude": -180, + "north_latitude": 90, + "east_longitude": 180 + }, + "id": { + "authority": "EPSG", + "code": 4326 + } + }, "type": "spatial" } }, @@ -447,7 +641,7 @@ ] } }, - "license": "proprietary", + "license": "CC-BY-4.0", "keywords": [ "GlobalCoastalAtlas", "DeltaPortfolio" @@ -455,12 +649,13 @@ "providers": [ { "name": "Deltares", - "description": "Deltares is an independent institute for applied research in the field of water and subsurface.", + "description": "Deltares is an independent knowledge institute for applied research in the field of water and subsurface.", "roles": [ "producer", - "processor" + "processor", + "host" ], - "url": "https://www.deltares.nl" + "url": "https://deltares.nl" } ], "assets": { diff --git a/STAC/data/scripts/01_shorelinemonitor_stacs.py b/STAC/data/scripts/01_shorelinemonitor_stacs.py index a385414b..352ec71b 100644 --- a/STAC/data/scripts/01_shorelinemonitor_stacs.py +++ b/STAC/data/scripts/01_shorelinemonitor_stacs.py @@ -54,6 +54,9 @@ with open(metadata_fp, "r") as f: metadata = json.load(f) + if "Creative Commons" in metadata["LICENSE"] and "4.0" in metadata["LICENSE"]: + metadata["LICENSE"] = "CC-BY-4.0" + # STAC configs STAC_DIR = "current" TEMPLATE_COLLECTION = "template" # stac template for dataset collection @@ -137,6 +140,9 @@ def get_paint_props(item_key: str): # cast zero terminated bytes to str because json library cannot write handle bytes ds = zero_terminated_bytes_as_str(ds) + # add the crs to match the STAC encoding with small letters + ds.attrs["crs"] = ds.attrs["CRS"] + # remove characters that cause problems in the frontend. ds = rm_special_characters( ds, dimensions_to_check=ADDITIONAL_DIMENSIONS, characters=["%"] @@ -163,6 +169,19 @@ def get_paint_props(item_key: str): title=COLLECTION_TITLE, description=DATASET_DESCRIPTION, keywords=["GlobalCoastalAtlas", "DeltaPortfolio"], + license=metadata["LICENSE"], + providers=[ + pystac.Provider( + name="Deltares", + roles=[ + pystac.provider.ProviderRole.PRODUCER, + pystac.provider.ProviderRole.PROCESSOR, + pystac.provider.ProviderRole.HOST, + ], + url="https://deltares.nl", + description=metadata["PROVIDERS"]["description"], + ), + ], ) # add datacube dimensions derived from xarray dataset to dataset stac_obj @@ -173,7 +192,7 @@ def get_paint_props(item_key: str): y_dimension=Y_DIMENSION, temporal_dimension=TEMPORAL_DIMENSION, additional_dimensions=ADDITIONAL_DIMENSIONS, - reference_system=ds.CRS, + # reference_system=ds.CRS, # note, when supplying a CRS string, this is not recognised as valid STAC CRS in a STAC fastAPI. We need to have it created but ds.attrs["CRS"] is not used by xstac. Hence above we set ds.attrs["crs"]. ) # generate stac feature keys (strings which will be stac item ids) for mapbox layers