Skip to content

Commit

Permalink
include experimental to /collections result
Browse files Browse the repository at this point in the history
  • Loading branch information
guss84 committed Aug 19, 2024
1 parent 1fb97b1 commit 12476c9
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions rest/openeo_collections/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
"SENTINEL2_L1C_SENTINELHUB": "SENTINEL2_L1C",
}

def build_basic_collection(collection_info):
basic_collection = {
"stac_version": collection_info["stac_version"],
"id": collection_info["id"],
"description": collection_info["description"],
"license": collection_info["license"],
"extent": collection_info["extent"],
"links": collection_info["links"],
}
if collection_info.get("experimental") is not None:
basic_collection["experimental"] = collection_info.get("experimental")

return basic_collection


class CollectionsProvider:
def __init__(self, id, url=None, directory=None):
Expand Down Expand Up @@ -99,14 +113,7 @@ def set_collections(self, collections):
def get_collections_basic_info(self):
self.check_if_loaded()
collections_basic_info = map(
lambda collection_info: {
"stac_version": collection_info["stac_version"],
"id": collection_info["id"],
"description": collection_info["description"],
"license": collection_info["license"],
"extent": collection_info["extent"],
"links": collection_info["links"],
},
build_basic_collection,
self.collections_cache.values(),
)

Expand Down

0 comments on commit 12476c9

Please sign in to comment.