eodash_catalog 0.0.29__py3-none-any.whl → 0.0.30__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.
- eodash_catalog/__about__.py +1 -1
- eodash_catalog/endpoints.py +39 -9
- eodash_catalog/stac_handling.py +2 -2
- {eodash_catalog-0.0.29.dist-info → eodash_catalog-0.0.30.dist-info}/METADATA +1 -1
- {eodash_catalog-0.0.29.dist-info → eodash_catalog-0.0.30.dist-info}/RECORD +8 -8
- {eodash_catalog-0.0.29.dist-info → eodash_catalog-0.0.30.dist-info}/WHEEL +0 -0
- {eodash_catalog-0.0.29.dist-info → eodash_catalog-0.0.30.dist-info}/entry_points.txt +0 -0
- {eodash_catalog-0.0.29.dist-info → eodash_catalog-0.0.30.dist-info}/licenses/LICENSE.txt +0 -0
eodash_catalog/__about__.py
CHANGED
eodash_catalog/endpoints.py
CHANGED
|
@@ -327,10 +327,10 @@ def handle_SH_WMS_endpoint(
|
|
|
327
327
|
catalog_config: dict, endpoint_config: dict, collection_config: dict, catalog: Catalog
|
|
328
328
|
) -> Collection:
|
|
329
329
|
# create collection and subcollections (based on locations)
|
|
330
|
+
root_collection = get_or_create_collection(
|
|
331
|
+
catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
|
|
332
|
+
)
|
|
330
333
|
if "Locations" in collection_config:
|
|
331
|
-
root_collection = get_or_create_collection(
|
|
332
|
-
catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
|
|
333
|
-
)
|
|
334
334
|
for location in collection_config["Locations"]:
|
|
335
335
|
# create and populate location collections based on times
|
|
336
336
|
# TODO: Should we add some new description per location?
|
|
@@ -373,6 +373,26 @@ def handle_SH_WMS_endpoint(
|
|
|
373
373
|
for c_child in root_collection.get_children():
|
|
374
374
|
if isinstance(c_child, Collection):
|
|
375
375
|
root_collection.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
|
|
376
|
+
else:
|
|
377
|
+
# if locations are not provided, treat the collection as a
|
|
378
|
+
# general proxy to the sentinel hub layer
|
|
379
|
+
times = get_collection_times_from_config(endpoint_config)
|
|
380
|
+
bbox = endpoint_config.get("Bbox", [-180, -85, 180, 85])
|
|
381
|
+
for time in times:
|
|
382
|
+
item = Item(
|
|
383
|
+
id=time,
|
|
384
|
+
bbox=bbox,
|
|
385
|
+
properties={},
|
|
386
|
+
geometry=None,
|
|
387
|
+
datetime=parser.isoparse(time),
|
|
388
|
+
stac_extensions=[
|
|
389
|
+
"https://stac-extensions.github.io/web-map-links/v1.1.0/schema.json",
|
|
390
|
+
],
|
|
391
|
+
)
|
|
392
|
+
add_projection_info(endpoint_config, item)
|
|
393
|
+
add_visualization_info(item, collection_config, endpoint_config, time=time)
|
|
394
|
+
item_link = root_collection.add_item(item)
|
|
395
|
+
item_link.extra_fields["datetime"] = time
|
|
376
396
|
# eodash v4 compatibility
|
|
377
397
|
add_collection_information(catalog_config, root_collection, collection_config)
|
|
378
398
|
add_visualization_info(root_collection, collection_config, endpoint_config)
|
|
@@ -606,16 +626,22 @@ def add_visualization_info(
|
|
|
606
626
|
"role": ["data"],
|
|
607
627
|
}
|
|
608
628
|
)
|
|
629
|
+
dimensions = {}
|
|
630
|
+
if dimensions_config := endpoint_config.get("Dimensions", {}):
|
|
631
|
+
for key, value in dimensions_config.items():
|
|
632
|
+
dimensions[key] = value
|
|
609
633
|
if time is not None:
|
|
610
634
|
if endpoint_config["Name"] == "Sentinel Hub WMS":
|
|
611
635
|
# SH WMS for public collections needs time interval, we use full day here
|
|
612
|
-
datetime_object = datetime.
|
|
636
|
+
datetime_object = datetime.fromisoformat(time)
|
|
613
637
|
start = datetime_object.isoformat()
|
|
614
638
|
end = (datetime_object + timedelta(days=1) - timedelta(milliseconds=1)).isoformat()
|
|
615
639
|
time_interval = f"{start}/{end}"
|
|
616
|
-
|
|
640
|
+
dimensions["TIME"] = time_interval
|
|
617
641
|
if endpoint_config["Name"] == "Sentinel Hub":
|
|
618
|
-
|
|
642
|
+
dimensions["TIME"] = time
|
|
643
|
+
if dimensions != {}:
|
|
644
|
+
extra_fields["wms:dimensions"] = dimensions
|
|
619
645
|
stac_object.add_link(
|
|
620
646
|
Link(
|
|
621
647
|
rel="wms",
|
|
@@ -632,10 +658,14 @@ def add_visualization_info(
|
|
|
632
658
|
"role": ["data"],
|
|
633
659
|
}
|
|
634
660
|
)
|
|
661
|
+
dimensions = {}
|
|
662
|
+
if dimensions_config := endpoint_config.get("Dimensions", {}):
|
|
663
|
+
for key, value in dimensions_config.items():
|
|
664
|
+
dimensions[key] = value
|
|
635
665
|
if time is not None:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
666
|
+
dimensions["TIME"] = time
|
|
667
|
+
if dimensions != {}:
|
|
668
|
+
extra_fields["wms:dimensions"] = dimensions
|
|
639
669
|
if "Styles" in endpoint_config:
|
|
640
670
|
extra_fields["wms:styles"] = endpoint_config["Styles"]
|
|
641
671
|
media_type = endpoint_config.get("MediaType", "image/jpeg")
|
eodash_catalog/stac_handling.py
CHANGED
|
@@ -44,7 +44,7 @@ def get_or_create_collection(
|
|
|
44
44
|
)
|
|
45
45
|
times: list[str] = []
|
|
46
46
|
temporal_extent = TemporalExtent([[datetime.now(), None]])
|
|
47
|
-
if endpoint_config
|
|
47
|
+
if endpoint_config:
|
|
48
48
|
if endpoint_config.get("Times"):
|
|
49
49
|
times = list(endpoint_config.get("Times", []))
|
|
50
50
|
times_datetimes = sorted([parser.isoparse(time) for time in times])
|
|
@@ -389,7 +389,7 @@ def add_extra_fields(stac_object: Collection | Link, collection_config: dict) ->
|
|
|
389
389
|
|
|
390
390
|
def get_collection_times_from_config(endpoint_config: dict) -> list[str]:
|
|
391
391
|
times: list[str] = []
|
|
392
|
-
if endpoint_config
|
|
392
|
+
if endpoint_config:
|
|
393
393
|
if endpoint_config.get("Times"):
|
|
394
394
|
times = list(endpoint_config.get("Times", []))
|
|
395
395
|
elif endpoint_config.get("DateTimeInterval"):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: eodash_catalog
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.30
|
|
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=
|
|
1
|
+
eodash_catalog/__about__.py,sha256=jhzZSQrCp7KQrReK8FJfif9ZfKLYZXTUzAui64xJkDs,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=
|
|
4
|
+
eodash_catalog/endpoints.py,sha256=ZMjPBPpSsgr-0PDfadD0TCkECxoua6kYCzOnTtfNG78,36257
|
|
5
5
|
eodash_catalog/generate_indicators.py,sha256=0IHhu_0yOUoUtLqiTsoYQ2IrTrq00yZme3UE6pC9PIU,19772
|
|
6
6
|
eodash_catalog/sh_endpoint.py,sha256=F99LpYT-MGhPiwdSSysm3xBTjaQBXRUkieh-q-vhTvE,1012
|
|
7
|
-
eodash_catalog/stac_handling.py,sha256=
|
|
7
|
+
eodash_catalog/stac_handling.py,sha256=lipa0_zGdVeTe4eiVcUQKejz4iJ87z7bIyuyxCVwj50,18310
|
|
8
8
|
eodash_catalog/thumbnails.py,sha256=31Wk38oNQDxfhSUbMLBpHuZFhsR8v_7luYr65XQtDf0,2213
|
|
9
9
|
eodash_catalog/utils.py,sha256=sW1YKOaDBFM3rkx458NIG8KGq8kuwGKjTvWhb2-y808,11044
|
|
10
|
-
eodash_catalog-0.0.
|
|
11
|
-
eodash_catalog-0.0.
|
|
12
|
-
eodash_catalog-0.0.
|
|
13
|
-
eodash_catalog-0.0.
|
|
14
|
-
eodash_catalog-0.0.
|
|
10
|
+
eodash_catalog-0.0.30.dist-info/METADATA,sha256=UCh3ufTL0kTABl2aWGVWEtSvG3HxJVyszXQgp2xxB1U,3203
|
|
11
|
+
eodash_catalog-0.0.30.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
12
|
+
eodash_catalog-0.0.30.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
|
|
13
|
+
eodash_catalog-0.0.30.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
|
|
14
|
+
eodash_catalog-0.0.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|