eodash_catalog 0.0.18__py3-none-any.whl → 0.0.19__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.0.18"
4
+ __version__ = "0.0.19"
@@ -136,6 +136,8 @@ def handle_STAC_based_endpoint(
136
136
  link.extra_fields["latlng"] = latlng
137
137
  link.extra_fields["name"] = location["Name"]
138
138
  add_example_info(collection, collection_config, endpoint_config, catalog_config)
139
+ # eodash v4 compatibility
140
+ add_visualization_info(collection, collection_config, endpoint_config)
139
141
  if "OverwriteBBox" in location:
140
142
  collection.extent.spatial = SpatialExtent(
141
143
  [
@@ -160,7 +162,8 @@ def handle_STAC_based_endpoint(
160
162
  headers=headers,
161
163
  bbox=bbox,
162
164
  )
163
-
165
+ # eodash v4 compatibility
166
+ add_visualization_info(root_collection, collection_config, endpoint_config)
164
167
  add_example_info(root_collection, collection_config, endpoint_config, catalog_config)
165
168
  return root_collection
166
169
 
@@ -306,6 +309,8 @@ def handle_collection_only(
306
309
  link = collection.add_item(item)
307
310
  link.extra_fields["datetime"] = t
308
311
  add_collection_information(catalog_config, collection, collection_config)
312
+ # eodash v4 compatibility
313
+ add_visualization_info(collection, collection_config, endpoint_config)
309
314
  return collection
310
315
 
311
316
 
@@ -359,6 +364,8 @@ def handle_SH_WMS_endpoint(
359
364
  for c_child in root_collection.get_children():
360
365
  if isinstance(c_child, Collection):
361
366
  root_collection.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
367
+ # eodash v4 compatibility
368
+ add_visualization_info(root_collection, collection_config, endpoint_config)
362
369
  return root_collection
363
370
 
364
371
 
@@ -512,7 +519,10 @@ def handle_WMS_endpoint(
512
519
  )
513
520
  # optionally filter time results
514
521
  if query := endpoint_config.get("Query"):
515
- datetime_query = [times[0], times[-1]]
522
+ datetime_query = [
523
+ parser.isoparse(times[0]).replace(tzinfo=timezone.utc),
524
+ parser.isoparse(times[-1]).replace(tzinfo=timezone.utc),
525
+ ]
516
526
  if start := query.get("Start"):
517
527
  datetime_query[0] = parser.isoparse(start).replace(tzinfo=timezone.utc)
518
528
  if end := query.get("End"):
@@ -549,6 +559,8 @@ def handle_WMS_endpoint(
549
559
  endpoint_config["OverwriteBBox"],
550
560
  ]
551
561
  )
562
+ # eodash v4 compatibility
563
+ add_visualization_info(collection, collection_config, endpoint_config)
552
564
  add_collection_information(catalog_config, collection, collection_config)
553
565
  return collection
554
566
 
@@ -576,6 +588,9 @@ def add_visualization_info(
576
588
  file_url: str | None = None,
577
589
  time: str | None = None,
578
590
  ) -> None:
591
+ extra_fields: dict[str, list[str] | dict[str, str]] = {}
592
+ if "Attribution" in endpoint_config:
593
+ extra_fields["attribution"] = endpoint_config["Attribution"]
579
594
  # add extension reference
580
595
  if endpoint_config["Name"] == "Sentinel Hub" or endpoint_config["Name"] == "Sentinel Hub WMS":
581
596
  instanceId = os.getenv("SH_INSTANCE_ID")
@@ -585,10 +600,12 @@ def add_visualization_info(
585
600
  # special handling for custom environment
586
601
  # (will take SH_INSTANCE_ID_{env_id}) as ENV VAR
587
602
  instanceId = os.getenv(f"SH_INSTANCE_ID_{env_id}")
588
- extra_fields: dict[str, list[str] | dict[str, str]] = {
589
- "wms:layers": [endpoint_config["LayerId"]],
590
- "role": ["data"],
591
- }
603
+ extra_fields.update(
604
+ {
605
+ "wms:layers": [endpoint_config["LayerId"]],
606
+ "role": ["data"],
607
+ }
608
+ )
592
609
  if time is not None:
593
610
  if endpoint_config["Name"] == "Sentinel Hub WMS":
594
611
  # SH WMS for public collections needs time interval, we use full day here
@@ -609,19 +626,19 @@ def add_visualization_info(
609
626
  )
610
627
  )
611
628
  elif endpoint_config["Name"] == "WMS":
612
- extra_fields = {
613
- "wms:layers": [endpoint_config["LayerId"]],
614
- "role": ["data"],
615
- }
629
+ extra_fields.update(
630
+ {
631
+ "wms:layers": [endpoint_config["LayerId"]],
632
+ "role": ["data"],
633
+ }
634
+ )
616
635
  if time is not None:
617
636
  extra_fields["wms:dimensions"] = {
618
637
  "TIME": time,
619
638
  }
620
639
  if "Styles" in endpoint_config:
621
640
  extra_fields["wms:styles"] = endpoint_config["Styles"]
622
- media_type = "image/jpeg"
623
- if "MediaType" in endpoint_config:
624
- media_type = endpoint_config["MediaType"]
641
+ media_type = endpoint_config.get("MediaType", "image/jpeg")
625
642
  endpoint_url = endpoint_config["EndPoint"]
626
643
  # custom replacing of all ENV VARS present as template in URL as {VAR}
627
644
  endpoint_url = replace_with_env_variables(endpoint_url)
@@ -637,9 +654,9 @@ def add_visualization_info(
637
654
  elif endpoint_config["Name"] == "JAXA_WMTS_PALSAR":
638
655
  target_url = "{}".format(endpoint_config.get("EndPoint"))
639
656
  # custom time just for this special case as a default for collection wmts
640
- extra_fields = {
641
- "wmts:layer": endpoint_config.get("LayerId", "").replace("{time}", time or "2017")
642
- }
657
+ extra_fields.update(
658
+ {"wmts:layer": endpoint_config.get("LayerId", "").replace("{time}", time or "2017")}
659
+ )
643
660
  stac_object.add_link(
644
661
  Link(
645
662
  rel="wmts",
@@ -680,14 +697,17 @@ def add_visualization_info(
680
697
  target=target_url,
681
698
  media_type="image/png",
682
699
  title="xcube tiles",
700
+ extra_fields=extra_fields,
683
701
  )
684
702
  )
685
- elif endpoint_config["Type"] == "WMTSCapabilities":
703
+ elif endpoint_config.get("Type") == "WMTSCapabilities":
686
704
  target_url = "{}".format(endpoint_config.get("EndPoint"))
687
- extra_fields = {
688
- "wmts:layer": endpoint_config.get("LayerId", ""),
689
- "role": ["data"],
690
- }
705
+ extra_fields.update(
706
+ {
707
+ "wmts:layer": endpoint_config.get("LayerId", ""),
708
+ "role": ["data"],
709
+ }
710
+ )
691
711
  dimensions = {}
692
712
  if time is not None:
693
713
  dimensions["time"] = time
@@ -717,6 +737,7 @@ def add_visualization_info(
717
737
  target=target_url,
718
738
  media_type="image/png",
719
739
  title=collection_config["Name"],
740
+ extra_fields=extra_fields,
720
741
  )
721
742
  )
722
743
  elif endpoint_config["Name"] == "GeoDB Vector Tiles":
@@ -728,20 +749,23 @@ def add_visualization_info(
728
749
  endpoint_config["Database"],
729
750
  endpoint_config["CollectionId"],
730
751
  )
752
+ extra_fields.update(
753
+ {
754
+ "description": collection_config["Title"],
755
+ "parameters": endpoint_config["Parameters"],
756
+ "matchKey": endpoint_config["MatchKey"],
757
+ "timeKey": endpoint_config["TimeKey"],
758
+ "source": endpoint_config["Source"],
759
+ "role": ["data"],
760
+ }
761
+ )
731
762
  stac_object.add_link(
732
763
  Link(
733
764
  rel="xyz",
734
765
  target=target_url,
735
766
  media_type="application/pbf",
736
767
  title=collection_config["Name"],
737
- extra_fields={
738
- "description": collection_config["Title"],
739
- "parameters": endpoint_config["Parameters"],
740
- "matchKey": endpoint_config["MatchKey"],
741
- "timeKey": endpoint_config["TimeKey"],
742
- "source": endpoint_config["Source"],
743
- "role": ["data"],
744
- },
768
+ extra_fields=extra_fields,
745
769
  )
746
770
  )
747
771
  else:
@@ -112,7 +112,8 @@ def create_web_map_link(layer_config: dict, role: str) -> Link:
112
112
  extra_fields["wmts:layer"] = layer_config["layer"]
113
113
  if "dimensions" in layer_config:
114
114
  extra_fields["wmts:dimensions"] = layer_config["dimensions"]
115
-
115
+ if "Attribution" in layer_config:
116
+ extra_fields["attribution"] = layer_config["Attribution"]
116
117
  wml = Link(
117
118
  rel=layer_config["protocol"],
118
119
  target=layer_config["url"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eodash_catalog
3
- Version: 0.0.18
3
+ Version: 0.0.19
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=qhKAhTix1N8_dYJ9ebFANzydGLRaBuHbCEZSda-fBeE,138
1
+ eodash_catalog/__about__.py,sha256=EaaUFYEaViLV7DjOe87CtSgI07ACcMtF642msXFVzjo,138
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=hL9rxeGcBpRr6wj6lcKxX7NtkLjP1auzwnt7zJjYVUo,33714
4
+ eodash_catalog/endpoints.py,sha256=SHPpPul9JbhsNZDq6kiE32-SiVApN4_-hhcejpGFRYs,34720
5
5
  eodash_catalog/generate_indicators.py,sha256=Fxq3sAXzZaPpE_RhiyFlnIvUBmf17tVFpoN2R_xLFGM,19109
6
6
  eodash_catalog/sh_endpoint.py,sha256=F99LpYT-MGhPiwdSSysm3xBTjaQBXRUkieh-q-vhTvE,1012
7
- eodash_catalog/stac_handling.py,sha256=sN-B2jTQZyQFhs7nvszI5n3qvsHqKoAXbxjyIaHpQmM,18201
7
+ eodash_catalog/stac_handling.py,sha256=vxzpTqKDnV_v9XtDoF2g8Lr7askGwZ-IVNK-G6ROu5s,18304
8
8
  eodash_catalog/thumbnails.py,sha256=31Wk38oNQDxfhSUbMLBpHuZFhsR8v_7luYr65XQtDf0,2213
9
9
  eodash_catalog/utils.py,sha256=44V-Pm9tl70nWahMPE4vl-9FzZbRkMVRQPdINdG_8F8,8975
10
- eodash_catalog-0.0.18.dist-info/METADATA,sha256=N-kEMopvt8_0J_3S2a9tRFCNZKKuXWm5abbidXMO7SY,3203
11
- eodash_catalog-0.0.18.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
- eodash_catalog-0.0.18.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
- eodash_catalog-0.0.18.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
- eodash_catalog-0.0.18.dist-info/RECORD,,
10
+ eodash_catalog-0.0.19.dist-info/METADATA,sha256=30ZZZmGYXsPTEXslcPboCDcjlSP8tECc-Ao4fg9CMD8,3203
11
+ eodash_catalog-0.0.19.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
+ eodash_catalog-0.0.19.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
+ eodash_catalog-0.0.19.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
+ eodash_catalog-0.0.19.dist-info/RECORD,,