eodash_catalog 0.0.18__tar.gz → 0.0.20__tar.gz
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.
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.bumpversion.cfg +1 -1
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/PKG-INFO +1 -1
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/__about__.py +1 -1
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/endpoints.py +54 -30
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/stac_handling.py +4 -1
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/test_generate.py +2 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-layers/baselayers.yaml +1 -2
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-layers/overlays.yaml +2 -3
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.github/workflows/ci.yml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.github/workflows/python-publish.yml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.gitignore +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.vscode/extensions.json +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/.vscode/settings.json +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/LICENSE.txt +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/README.md +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/pyproject.toml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/requirements.txt +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/ruff.toml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/__init__.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/duration.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/generate_indicators.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/sh_endpoint.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/thumbnails.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/src/eodash_catalog/utils.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/__init__.py +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/test-data/regional_forecast.json +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-catalogs/testing.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_CROPOMAT1.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_see_solar_energy.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_tif_demo_1.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_tif_demo_2.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_wms_no_time.yaml +0 -0
- {eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-indicators/test_indicator.yaml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: eodash_catalog
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.20
|
|
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
|
|
@@ -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 = [
|
|
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
|
|
589
|
-
|
|
590
|
-
|
|
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
|
-
|
|
614
|
-
|
|
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",
|
|
@@ -660,7 +677,7 @@ def add_visualization_info(
|
|
|
660
677
|
vmin = endpoint_config["Rescale"][0]
|
|
661
678
|
vmax = endpoint_config["Rescale"][1]
|
|
662
679
|
# depending on numerical input only
|
|
663
|
-
data_projection = endpoint_config.get("DataProjection", 3857)
|
|
680
|
+
data_projection = str(endpoint_config.get("DataProjection", 3857))
|
|
664
681
|
epsg_prefix = "" if "EPSG:" in data_projection else "EPSG:"
|
|
665
682
|
crs = f"{epsg_prefix}{data_projection}"
|
|
666
683
|
target_url = (
|
|
@@ -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
|
|
703
|
+
elif endpoint_config.get("Type") == "WMTSCapabilities":
|
|
686
704
|
target_url = "{}".format(endpoint_config.get("EndPoint"))
|
|
687
|
-
extra_fields
|
|
688
|
-
|
|
689
|
-
|
|
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"],
|
|
@@ -364,6 +365,8 @@ def add_extra_fields(stac_object: Collection | Link, collection_config: dict) ->
|
|
|
364
365
|
stac_object.extra_fields["agency"] = collection_config["Agency"]
|
|
365
366
|
if "EodashIdentifier" in collection_config:
|
|
366
367
|
stac_object.extra_fields["subcode"] = collection_config["EodashIdentifier"]
|
|
368
|
+
if "CollectionGroup" in collection_config:
|
|
369
|
+
stac_object.extra_fields["collection_group"] = collection_config["CollectionGroup"]
|
|
367
370
|
if "DataSource" in collection_config:
|
|
368
371
|
if "Spaceborne" in collection_config["DataSource"]:
|
|
369
372
|
if "Sensor" in collection_config["DataSource"]["Spaceborne"]:
|
|
@@ -120,6 +120,8 @@ def test_baselayers_and_overlays_added(catalog_output_folder):
|
|
|
120
120
|
]
|
|
121
121
|
assert len(baselayer_links) == 1
|
|
122
122
|
assert len(overlay_links) == 1
|
|
123
|
+
# test that attribution gets passed to a link dict
|
|
124
|
+
assert "attribution" in baselayer_links[0]
|
|
123
125
|
|
|
124
126
|
|
|
125
127
|
def test_geojson_dataset_handled(catalog_output_folder):
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
name: EOxCloudless 2022
|
|
3
3
|
url: '//s2maps-tiles.eu/wmts/1.0.0/s2cloudless-2022_3857/default/g/{z}/{y}/{x}.jpeg'
|
|
4
4
|
media_type: image/jpeg
|
|
5
|
-
|
|
6
|
-
maxNativeZoom: 17
|
|
5
|
+
Attribution: '{ EOxCloudless 2022: <a xmlns:dct="http://purl.org/dc/terms/" href="//s2maps.eu" target="_blank" property="dct:title">Sentinel-2 cloudless - s2maps.eu</a> by <a xmlns:cc="http://creativecommons.org/ns#" href="//eox.at" target="_blank" property="cc:attributionName" rel="cc:attributionURL">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data 2022) }'
|
|
7
6
|
protocol: 'xyz'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
- id: overlay_bright
|
|
2
2
|
name: 'Overlay labels'
|
|
3
3
|
url: '//s2maps-tiles.eu/wmts/1.0.0/overlay_base_bright_3857/default/g/{z}/{y}/{x}.png'
|
|
4
|
-
|
|
4
|
+
Attribution: '{ Overlay: Data © <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors, Made with Natural Earth, Rendering © <a href="//eox.at" target="_blank">EOX</a> }'
|
|
5
5
|
visible: true
|
|
6
|
-
|
|
7
|
-
protocol: 'xyz'
|
|
6
|
+
protocol: 'xyz'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_CROPOMAT1.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_see_solar_energy.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_tif_demo_1.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_tif_demo_2.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-collections/test_wms_no_time.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.0.18 → eodash_catalog-0.0.20}/tests/testing-indicators/test_indicator.yaml
RENAMED
|
File without changes
|