eodash_catalog 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eodash_catalog might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Daniel Santillan <daniel.santillan@eox.at>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.1.6"
4
+ __version__ = "0.1.8"
@@ -120,6 +120,7 @@ def process_STAC_Datacube_Endpoint(
120
120
  geometry=item.geometry,
121
121
  datetime=dt,
122
122
  )
123
+ add_visualization_info(new_item, collection_config, endpoint_config)
123
124
  link = collection.add_item(new_item)
124
125
  # bubble up information we want to the link
125
126
  link.extra_fields["datetime"] = format_datetime_to_isostring_zulu(dt)
@@ -670,6 +671,9 @@ def add_visualization_info(
670
671
  ) -> None:
671
672
  extra_fields: dict[str, list[str] | dict[str, str]] = {}
672
673
  if "Attribution" in endpoint_config:
674
+ stac_object.stac_extensions.append(
675
+ "https://stac-extensions.github.io/attribution/v0.1.0/schema.json"
676
+ )
673
677
  extra_fields["attribution"] = endpoint_config["Attribution"]
674
678
  # add extension reference
675
679
  if endpoint_config["Name"] == "Sentinel Hub" or endpoint_config["Name"] == "Sentinel Hub WMS":
@@ -821,13 +825,15 @@ def add_visualization_info(
821
825
  data_projection = str(endpoint_config.get("DataProjection", 3857))
822
826
  epsg_prefix = "" if "EPSG:" in data_projection else "EPSG:"
823
827
  crs = f"{epsg_prefix}{data_projection}"
828
+ time = stac_object.get_datetime() if isinstance(stac_object, Item) else "{time}"
824
829
  target_url = (
825
- "{}/tiles/{}/{}/{{z}}/{{y}}/{{x}}" "?crs={}&time={{time}}&vmin={}&vmax={}&cbar={}"
830
+ "{}/tiles/{}/{}/{{z}}/{{y}}/{{x}}" "?crs={}&time={}&vmin={}&vmax={}&cbar={}"
826
831
  ).format(
827
832
  endpoint_config["EndPoint"],
828
833
  endpoint_config["DatacubeId"],
829
834
  endpoint_config["Variable"],
830
835
  crs,
836
+ time,
831
837
  vmin,
832
838
  vmax,
833
839
  cbar,
@@ -989,6 +995,11 @@ def handle_raw_source(
989
995
  assets=assets,
990
996
  extra_fields={},
991
997
  )
998
+ if "Attribution" in endpoint_config:
999
+ item.stac_extensions.append(
1000
+ "https://stac-extensions.github.io/attribution/v0.1.0/schema.json"
1001
+ )
1002
+ asset.extra_fields["attribution"] = endpoint_config["Attribution"]
992
1003
  add_projection_info(
993
1004
  endpoint_config,
994
1005
  item,
@@ -179,6 +179,7 @@ def process_indicator_file(
179
179
  f"{options.collectionspath}/{collection}.yaml",
180
180
  parent_indicator,
181
181
  options,
182
+ "Disable" in indicator_config and collection in indicator_config["Disable"],
182
183
  )
183
184
  else:
184
185
  # we assume that collection files can also be loaded directly
@@ -200,7 +201,11 @@ def process_indicator_file(
200
201
 
201
202
  @retry((Exception), tries=3, delay=5, backoff=2, logger=LOGGER)
202
203
  def process_collection_file(
203
- catalog_config: dict, file_path: str, catalog: Catalog | Collection, options: Options
204
+ catalog_config: dict,
205
+ file_path: str,
206
+ catalog: Catalog | Collection,
207
+ options: Options,
208
+ disable=False,
204
209
  ):
205
210
  LOGGER.info(f"Processing collection: {file_path}")
206
211
  with open(file_path) as f:
@@ -270,7 +275,9 @@ def process_collection_file(
270
275
  if collection:
271
276
  add_single_item_if_collection_empty(collection)
272
277
  add_projection_info(endpoint_config, collection)
273
- add_to_catalog(collection, catalog, endpoint_config, collection_config)
278
+ add_to_catalog(
279
+ collection, catalog, endpoint_config, collection_config, disable
280
+ )
274
281
  else:
275
282
  raise Exception(
276
283
  f"No collection was generated for resource {endpoint_config}"
@@ -362,7 +369,7 @@ def process_collection_file(
362
369
 
363
370
 
364
371
  def add_to_catalog(
365
- collection: Collection, catalog: Catalog, endpoint: dict, collection_config: dict
372
+ collection: Collection, catalog: Catalog, endpoint: dict, collection_config: dict, disable=False
366
373
  ):
367
374
  # check if already in catalog, if it is do not re-add it
368
375
  # TODO: probably we should add to the catalog only when creating
@@ -392,6 +399,8 @@ def add_to_catalog(
392
399
  if "Themes" in collection_config:
393
400
  link.extra_fields["themes"] = collection_config["Themes"]
394
401
  # Check for summaries and bubble up info
402
+ if disable:
403
+ link.extra_fields["roles"] = ["disable"]
395
404
  if collection.summaries.lists:
396
405
  for summary in collection.summaries.lists:
397
406
  link.extra_fields[summary] = collection.summaries.lists[summary]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eodash_catalog
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: This package is intended to help create a compatible STAC catalog for the eodash dashboard client. It supports configuration of multiple endpoint types for information extraction.
5
5
  Project-URL: Documentation, https://github.com/eodash/eodash_catalog#readme
6
6
  Project-URL: Issues, https://github.com/eodash/eodash_catalog/issues
@@ -1,14 +1,14 @@
1
- eodash_catalog/__about__.py,sha256=T6gKKw7BD372nQEmlOKE7dfhE3sHoynNeoZJkBAf_1s,137
1
+ eodash_catalog/__about__.py,sha256=Suv8M7NmJ_IR_KeM80feexn6iHCp66qCdMfm0fV59ac,137
2
2
  eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
3
3
  eodash_catalog/duration.py,sha256=B6XOZfvNU7SuqpxuVtT1kNKODoOQJXDI6mocvA_U1ik,10816
4
- eodash_catalog/endpoints.py,sha256=l7gTeULisRwZU-kNpM-KV9lfIqZ6ekT34b82QxelqPY,40942
5
- eodash_catalog/generate_indicators.py,sha256=mm673GReuBQLhn5ZQhHkbKT9NdqzRM-3sPjbgcGtJ_g,20362
4
+ eodash_catalog/endpoints.py,sha256=b0vIQOLGqANm7qaaAap0IeW11yPzjo6-VXqcKCY41ag,41543
5
+ eodash_catalog/generate_indicators.py,sha256=jqPns3KOZA8GEcxGYD6NcYa5iGtjKcrKkW7LLv13PRQ,20634
6
6
  eodash_catalog/sh_endpoint.py,sha256=XjZsZJ5jfJZLQenSTqUhiUZ5YAu9M9nv2KL1Qv3Be-I,1219
7
7
  eodash_catalog/stac_handling.py,sha256=8_W45SIXV4jAUa9J-f2KZ2eor6MNfPfy0n1d-932eAE,21234
8
8
  eodash_catalog/thumbnails.py,sha256=qZDcpQe80ki6lEMKYdZtSnnHH0PUpcoXTvU9bYdPlzU,2260
9
9
  eodash_catalog/utils.py,sha256=QhZeMXRC1uvE3VzC3T_nMi9hn_3RR05s5rkzs8tCeQc,13866
10
- eodash_catalog-0.1.6.dist-info/METADATA,sha256=5j8aiBSZ2scBi3a5_zKzGt0KjCIMIgAUrFjWxUcmojg,3195
11
- eodash_catalog-0.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- eodash_catalog-0.1.6.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
- eodash_catalog-0.1.6.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
- eodash_catalog-0.1.6.dist-info/RECORD,,
10
+ eodash_catalog-0.1.8.dist-info/METADATA,sha256=7ETkKNNhQX2F6eH6scnpd0gBfS-VWUBkG7piWHQfmJU,3195
11
+ eodash_catalog-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ eodash_catalog-0.1.8.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
+ eodash_catalog-0.1.8.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
+ eodash_catalog-0.1.8.dist-info/RECORD,,