Skip to content

Commit

Permalink
Add wofl collection (#4)
Browse files Browse the repository at this point in the history
* added wofl, I think

* needlessly overwrote wofs

* Update dep_collections/dep_ls_wofl.py

Co-authored-by: Alex Leith <[email protected]>

---------

Co-authored-by: Alex Leith <[email protected]>
  • Loading branch information
jessjaco and alexgleith authored Oct 3, 2024
1 parent 159b025 commit 88fd1b5
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 2 deletions.
102 changes: 102 additions & 0 deletions collections/dep_ls_wofl.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
8 changes: 6 additions & 2 deletions create_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
)
58 changes: 58 additions & 0 deletions dep_collections/dep_ls_wofl.py
Original file line number Diff line number Diff line change
@@ -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"],
},
),
)

0 comments on commit 88fd1b5

Please sign in to comment.