From 88fd1b5d53c65bcb21925e25567c68c8248f9f3d Mon Sep 17 00:00:00 2001 From: Jesse Anderson Date: Thu, 3 Oct 2024 16:05:03 -0700 Subject: [PATCH] Add wofl collection (#4) * added wofl, I think * needlessly overwrote wofs * Update dep_collections/dep_ls_wofl.py Co-authored-by: Alex Leith --------- Co-authored-by: Alex Leith --- collections/dep_ls_wofl.json | 102 +++++++++++++++++++++++++++++++++ create_collections.py | 8 ++- dep_collections/dep_ls_wofl.py | 58 +++++++++++++++++++ 3 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 collections/dep_ls_wofl.json create mode 100644 dep_collections/dep_ls_wofl.py diff --git a/collections/dep_ls_wofl.json b/collections/dep_ls_wofl.json new file mode 100644 index 0000000..1428a8a --- /dev/null +++ b/collections/dep_ls_wofl.json @@ -0,0 +1,102 @@ +{ + "type": "Collection", + "id": "dep_ls_wofl", + "stac_version": "1.0.0", + "description": "Water observations from space (WOfS) feature layers", + "links": [ + { + "rel": "root", + "href": "https://stac.staging.digitalearthpacific.org/collections/dep_ls_wofl", + "type": "application/json", + "title": "WOfS feature layer" + }, + { + "rel": "self", + "href": "https://stac.staging.digitalearthpacific.org/collections/dep_ls_wofl", + "type": "application/json" + } + ], + "title": "WOfS feature layer", + "extent": { + "spatial": { + "bbox": [ + [ + -180, + -90, + 180, + 90 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1980-01-01T00:00:00Z", + null + ] + ] + } + }, + "license": "CC-BY-4.0", + "keywords": [ + "Landsat", + "WOfS", + "WOFL", + "Water", + "Pacific" + ], + "providers": [ + { + "name": "Digital Earth Pacific", + "roles": [ + "processor", + "host" + ], + "url": "https://digitalearthpacific.org" + }, + { + "name": "Amazon", + "roles": [ + "host" + ], + "url": "https://amazon.com" + }, + { + "name": "USGS", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.usgs.gov/landsat-missions/landsat-collection-2-level-2-science-products" + }, + { + "name": "NASA", + "roles": [ + "licensor" + ], + "url": "https://www.nasa.gov/" + } + ], + "summaries": { + "gsd": [ + 30 + ], + "eo:bands": [ + { + "name": "water", + "common_name": "water", + "description": "Water feature layer for a single date and time", + "min": 0, + "max": 256, + "nodata": 1 + } + ], + "platform": [ + "landsat-5", + "landsat-7", + "landsat-8", + "landsat-9" + ] + } +} \ No newline at end of file diff --git a/create_collections.py b/create_collections.py index 226e1bc..6e629e1 100755 --- a/create_collections.py +++ b/create_collections.py @@ -4,6 +4,7 @@ from dep_collections.dep_ls_geomad import dep_ls_geomad from dep_collections.dep_ls_wofs import dep_ls_wofs +from dep_collections.dep_ls_wofl import dep_ls_wofl from dep_collections.dep_s1_mosaic import dep_s1_mosaic from dep_collections.dep_s2_geomad import dep_s2_geomad from dep_collections.dep_s2_mangroves import dep_s2_mangroves @@ -17,11 +18,12 @@ all_collections = ( dep_ls_wofs, + dep_ls_wofl, dep_ls_geomad, dep_s2_geomad, dep_s2_mangroves, dep_s1_mosaic, - dep_s2s1_mrd + dep_s2s1_mrd, ) for collection in all_collections: @@ -30,4 +32,6 @@ collection.set_self_href(collection_url) print(f"Writing {collection.id} to {out_dir}") - collection_dict = collection.save_object(dest_href=out_dir / f"{collection.id}.json") + collection_dict = collection.save_object( + dest_href=out_dir / f"{collection.id}.json" + ) diff --git a/dep_collections/dep_ls_wofl.py b/dep_collections/dep_ls_wofl.py new file mode 100644 index 0000000..982abfa --- /dev/null +++ b/dep_collections/dep_ls_wofl.py @@ -0,0 +1,58 @@ +from pystac import ( + Collection, + Extent, + SpatialExtent, + TemporalExtent, + Provider, + Summaries, +) +from datetime import datetime, timezone + +dep_ls_wofl_extent = Extent( + SpatialExtent([[-180, -90, 180, 90]]), + TemporalExtent([[datetime(1980, 1, 1, 0, 0, 0, 0, timezone.utc), None]]), +) + +# Create a Collection +dep_ls_wofl = Collection( + id="dep_ls_wofl", + description="Water observations from space (WOfS) feature layers", + title="WOfS feature layer", + extent=dep_ls_wofl_extent, + license="CC-BY-4.0", + keywords=["Landsat", "WOfS", "WOFL", "Water", "Pacific"], + providers=[ + Provider( + name="Digital Earth Pacific", + roles=["processor", "host"], + url="https://digitalearthpacific.org", + ), + Provider( + name="Amazon", + roles=["host"], + url="https://aws.amazon.com/", + ), + Provider( + name="USGS", + roles=["producer", "processor", "licensor"], + url="https://www.usgs.gov/landsat-missions/landsat-collection-2-level-2-science-products", + ), + Provider(name="NASA", roles=["licensor"], url="https://www.nasa.gov/"), + ], + summaries=Summaries( + { + "gsd": [30], + "eo:bands": [ + { + "name": "water", + "common_name": "water", + "description": "Water feature layer for a single date and time", + "min": 0, + "max": 256, + "nodata": 1, + }, + ], + "platform": ["landsat-5", "landsat-7", "landsat-8", "landsat-9"], + }, + ), +)