Skip to content

Commit

Permalink
feat: added possibility to set Bbox for a SH resource; Added possibli…
Browse files Browse the repository at this point in the history
…ty to overwriteBBox for a SH resource
  • Loading branch information
santilland committed Jan 23, 2024
1 parent 0285f3f commit a22b502
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,23 @@ def handle_STAC_based_endpoint(config, endpoint, data, catalog, headers=None):
c_child.extent.spatial.bboxes[0]
)
else:
root_collection = process_STACAPI_Endpoint(
config=config,
endpoint=endpoint,
data=data,
catalog=catalog,
headers=headers,
)
if "Bbox" in endpoint:
root_collection = process_STACAPI_Endpoint(
config=config,
endpoint=endpoint,
data=data,
catalog=catalog,
headers=headers,
bbox=",".join(map(str,endpoint["Bbox"])),
)
else:
root_collection = process_STACAPI_Endpoint(
config=config,
endpoint=endpoint,
data=data,
catalog=catalog,
headers=headers,
)

add_example_info(root_collection, data, endpoint, config)
add_to_catalog(root_collection, catalog, endpoint, data)
Expand Down Expand Up @@ -689,6 +699,12 @@ def process_STACAPI_Endpoint(config, endpoint, data, catalog, headers={}, bbox=N
collection.id = data["Name"]
add_collection_information(config, collection, data)

# Check if we need to overwrite the bbox after update from items
if "OverwriteBBox" in endpoint:
collection.extent.spatial = SpatialExtent([
endpoint["OverwriteBBox"],
])

return collection

def fetch_and_save_thumbnail(data, url):
Expand Down

0 comments on commit a22b502

Please sign in to comment.