Skip to content

Commit

Permalink
Issue #5 add merging for crs and datasource_type fields
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVerstraelen authored and soxofaan committed Sep 16, 2022
1 parent c0f153e commit 5e45c1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ def _merge_collection_metadata(self, by_backend: Dict[str, dict]) -> dict:
# TODO: assets ? For now, take the union.
result["assets"] = list(getter.union("assets"))

# crs
crs_list = getter.union("crs", skip_duplicates=True)
if crs_list:
result["crs"] = list(crs_list)
# datasource_type
data_source_type = getter.first("datasource_type", default=None)
if data_source_type:
result["datasource_type"] = data_source_type
return result

@staticmethod
Expand Down

0 comments on commit 5e45c1a

Please sign in to comment.