Skip to content

Commit

Permalink
Issue #5 add merging for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVerstraelen authored and soxofaan committed Sep 16, 2022
1 parent 88201ec commit c0f153e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,16 @@ def _merge_collection_metadata(self, by_backend: Dict[str, dict]) -> dict:
cube_dimensions = getter.first("cube:dimensions")
if cube_dimensions:
result["cube:dimensions"] = cube_dimensions
# TODO merge existing summaries?
result["summaries"] = {
# TODO: use a more robust/user friendly backend pointer than backend id (which is internal implementation detail)
self.STAC_PROPERTY_PROVIDER_BACKEND: list(by_backend.keys())
}
# TODO: assets ?
# summaries
# TODO: Better merging for summaries?
for summary in getter.get("summaries"):
print(summary)
result["summaries"] = {}
# TODO: use a more robust/user friendly backend pointer than backend id (which is internal implementation detail)
result["summaries"][self.STAC_PROPERTY_PROVIDER_BACKEND] = list(by_backend.keys())
# assets
# TODO: assets ? For now, take the union.
result["assets"] = list(getter.union("assets"))

return result

Expand Down

0 comments on commit c0f153e

Please sign in to comment.