eodash_catalog 0.1.3__py3-none-any.whl → 0.1.5__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/generate_indicators.py +3 -0
- eodash_catalog/stac_handling.py +66 -2
- eodash_catalog/utils.py +7 -0
- {eodash_catalog-0.1.3.dist-info → eodash_catalog-0.1.5.dist-info}/METADATA +4 -3
- eodash_catalog-0.1.5.dist-info/RECORD +14 -0
- {eodash_catalog-0.1.3.dist-info → eodash_catalog-0.1.5.dist-info}/WHEEL +1 -1
- eodash_catalog-0.1.3.dist-info/RECORD +0 -14
- {eodash_catalog-0.1.3.dist-info → eodash_catalog-0.1.5.dist-info}/entry_points.txt +0 -0
- {eodash_catalog-0.1.3.dist-info → eodash_catalog-0.1.5.dist-info}/licenses/LICENSE.txt +0 -0
eodash_catalog/__about__.py
CHANGED
|
@@ -33,6 +33,7 @@ from eodash_catalog.stac_handling import (
|
|
|
33
33
|
add_base_overlay_info,
|
|
34
34
|
add_collection_information,
|
|
35
35
|
add_extra_fields,
|
|
36
|
+
add_process_info,
|
|
36
37
|
add_projection_info,
|
|
37
38
|
get_or_create_collection,
|
|
38
39
|
)
|
|
@@ -191,6 +192,7 @@ def process_indicator_file(
|
|
|
191
192
|
parent_indicator.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
|
|
192
193
|
# extract collection information and add it to summary indicator level
|
|
193
194
|
extract_indicator_info(parent_indicator)
|
|
195
|
+
add_process_info(parent_indicator, catalog_config, indicator_config)
|
|
194
196
|
# add baselayer and overview information to indicator collection
|
|
195
197
|
add_base_overlay_info(parent_indicator, catalog_config, indicator_config)
|
|
196
198
|
add_to_catalog(parent_indicator, catalog, {}, indicator_config)
|
|
@@ -339,6 +341,7 @@ def process_collection_file(
|
|
|
339
341
|
parent_collection.add_links(links)
|
|
340
342
|
|
|
341
343
|
add_collection_information(catalog_config, parent_collection, collection_config)
|
|
344
|
+
add_process_info(catalog_config, parent_collection, collection_config)
|
|
342
345
|
parent_collection.update_extent_from_items()
|
|
343
346
|
# Add bbox extents from children
|
|
344
347
|
for c_child in parent_collection.get_children():
|
eodash_catalog/stac_handling.py
CHANGED
|
@@ -19,6 +19,7 @@ from yaml.loader import SafeLoader
|
|
|
19
19
|
|
|
20
20
|
from eodash_catalog.utils import (
|
|
21
21
|
generateDatetimesFromInterval,
|
|
22
|
+
get_full_url,
|
|
22
23
|
parse_datestring_to_tz_aware_datetime,
|
|
23
24
|
)
|
|
24
25
|
|
|
@@ -85,6 +86,26 @@ def get_or_create_collection(
|
|
|
85
86
|
return collection
|
|
86
87
|
|
|
87
88
|
|
|
89
|
+
def create_service_link(endpoint_config: dict, catalog_config: dict) -> Link:
|
|
90
|
+
extra_fields = {
|
|
91
|
+
"id": endpoint_config["Identifier"],
|
|
92
|
+
"method": endpoint_config.get("Method", "GET"),
|
|
93
|
+
}
|
|
94
|
+
if "EndPoint" in endpoint_config:
|
|
95
|
+
extra_fields["endpoint"] = endpoint_config["EndPoint"]
|
|
96
|
+
if "Body" in endpoint_config:
|
|
97
|
+
extra_fields["body"] = get_full_url(endpoint_config["Body"], catalog_config)
|
|
98
|
+
if "Flatstyle" in endpoint_config:
|
|
99
|
+
extra_fields["eox:flatstyle"] = get_full_url(endpoint_config["Flatstyle"], catalog_config)
|
|
100
|
+
sl = Link(
|
|
101
|
+
rel="service",
|
|
102
|
+
target=endpoint_config["Url"],
|
|
103
|
+
media_type=endpoint_config["Type"],
|
|
104
|
+
extra_fields=extra_fields,
|
|
105
|
+
)
|
|
106
|
+
return sl
|
|
107
|
+
|
|
108
|
+
|
|
88
109
|
def create_web_map_link(layer_config: dict, role: str) -> Link:
|
|
89
110
|
extra_fields = {
|
|
90
111
|
"roles": [role],
|
|
@@ -299,8 +320,7 @@ def add_collection_information(
|
|
|
299
320
|
)
|
|
300
321
|
# Bubble up thumbnail to extra fields
|
|
301
322
|
collection.extra_fields["thumbnail"] = (
|
|
302
|
-
f'{catalog_config["assets_endpoint"]}/'
|
|
303
|
-
f'{collection_config["Image"]}'
|
|
323
|
+
f'{catalog_config["assets_endpoint"]}/' f'{collection_config["Image"]}'
|
|
304
324
|
)
|
|
305
325
|
# Add extra fields to collection if available
|
|
306
326
|
add_extra_fields(collection, collection_config)
|
|
@@ -326,6 +346,50 @@ def add_collection_information(
|
|
|
326
346
|
collection.extra_fields["eox:colorlegend"] = collection_config["Colorlegend"]
|
|
327
347
|
|
|
328
348
|
|
|
349
|
+
def add_process_info(collection: Collection, catalog_config: dict, collection_config: dict) -> None:
|
|
350
|
+
if "Process" in collection_config:
|
|
351
|
+
if "EndPoints" in collection_config["Process"]:
|
|
352
|
+
for endpoint in collection_config["Process"]["EndPoints"]:
|
|
353
|
+
collection.add_link(create_service_link(endpoint, catalog_config))
|
|
354
|
+
if "JsonForm" in collection_config["Process"]:
|
|
355
|
+
collection.extra_fields["eodash:jsonform"] = get_full_url(
|
|
356
|
+
collection_config["Process"]["JsonForm"], catalog_config
|
|
357
|
+
)
|
|
358
|
+
if "VegaDefinition" in collection_config["Process"]:
|
|
359
|
+
collection.extra_fields["eodash:vegadefinition"] = get_full_url(
|
|
360
|
+
collection_config["Process"]["VegaDefinition"], catalog_config
|
|
361
|
+
)
|
|
362
|
+
elif "Resources" in collection_config:
|
|
363
|
+
# see if geodb resource configured use defaults if available
|
|
364
|
+
for resource in collection_config["Resources"]:
|
|
365
|
+
if resource["Name"] == "GeoDB":
|
|
366
|
+
if "geodb_default_form" in catalog_config:
|
|
367
|
+
collection.extra_fields["eodash:jsonform"] = get_full_url(
|
|
368
|
+
catalog_config["geodb_default_form"], catalog_config
|
|
369
|
+
)
|
|
370
|
+
if "geodb_default_vega" in catalog_config:
|
|
371
|
+
collection.extra_fields["eodash:vegadefinition"] = get_full_url(
|
|
372
|
+
catalog_config["geodb_default_vega"], catalog_config
|
|
373
|
+
)
|
|
374
|
+
query_string = "?aoi_id=eq.{{feature}}&select=site_name,city,color_code,time,aoi,measurement_value,indicator_value,reference_time,eo_sensor,reference_value,input_data" # noqa: E501
|
|
375
|
+
collection.add_link(
|
|
376
|
+
Link(
|
|
377
|
+
rel="service",
|
|
378
|
+
target="{}{}_{}{}".format(
|
|
379
|
+
resource["EndPoint"],
|
|
380
|
+
resource["Database"],
|
|
381
|
+
resource["CollectionId"],
|
|
382
|
+
query_string,
|
|
383
|
+
),
|
|
384
|
+
media_type="application/json",
|
|
385
|
+
extra_fields={
|
|
386
|
+
"method": "GET",
|
|
387
|
+
"id": resource["CollectionId"],
|
|
388
|
+
},
|
|
389
|
+
)
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
|
|
329
393
|
def add_base_overlay_info(
|
|
330
394
|
collection: Collection, catalog_config: dict, collection_config: dict
|
|
331
395
|
) -> None:
|
eodash_catalog/utils.py
CHANGED
|
@@ -385,3 +385,10 @@ def format_datetime_to_isostring_zulu(datetime_obj: datetime) -> str:
|
|
|
385
385
|
# we rather convert it to Zulu based string in order for various clients
|
|
386
386
|
# to understand it better (WMS)
|
|
387
387
|
return (datetime_obj.replace(microsecond=0).isoformat()).replace("+00:00", "Z")
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def get_full_url(url: str, catalog_config) -> str:
|
|
391
|
+
if url.startswith("http"):
|
|
392
|
+
return url
|
|
393
|
+
else:
|
|
394
|
+
return f'{catalog_config["assets_endpoint"]}{url}'
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: eodash_catalog
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
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
|
|
7
7
|
Project-URL: Source, https://github.com/eodash/eodash_catalog
|
|
8
8
|
Author-email: Daniel Santillan <daniel.santillan@eox.at>
|
|
9
|
-
License: MIT
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE.txt
|
|
10
11
|
Classifier: Development Status :: 4 - Beta
|
|
11
12
|
Classifier: Programming Language :: Python
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
eodash_catalog/__about__.py,sha256=TvYmyaSMGR_Lg0vkZYYlus6y_vSGTjlFPBDMkpp2VKM,137
|
|
2
|
+
eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
|
|
3
|
+
eodash_catalog/duration.py,sha256=B6XOZfvNU7SuqpxuVtT1kNKODoOQJXDI6mocvA_U1ik,10816
|
|
4
|
+
eodash_catalog/endpoints.py,sha256=RfjwEz9Yo4X1zWnwPC-xqhSy_OphazKv5Edruf8pBOU,40821
|
|
5
|
+
eodash_catalog/generate_indicators.py,sha256=GSWkfpkqqdMNiL3pC7Wp3_nqllBsfbt9OM7VQUq2UiE,20246
|
|
6
|
+
eodash_catalog/sh_endpoint.py,sha256=XjZsZJ5jfJZLQenSTqUhiUZ5YAu9M9nv2KL1Qv3Be-I,1219
|
|
7
|
+
eodash_catalog/stac_handling.py,sha256=8_W45SIXV4jAUa9J-f2KZ2eor6MNfPfy0n1d-932eAE,21234
|
|
8
|
+
eodash_catalog/thumbnails.py,sha256=qZDcpQe80ki6lEMKYdZtSnnHH0PUpcoXTvU9bYdPlzU,2260
|
|
9
|
+
eodash_catalog/utils.py,sha256=QhZeMXRC1uvE3VzC3T_nMi9hn_3RR05s5rkzs8tCeQc,13866
|
|
10
|
+
eodash_catalog-0.1.5.dist-info/METADATA,sha256=U1wm94Mccrc4JRpGNXGRttQ84kbmFyORmAXA5HTdQvk,3195
|
|
11
|
+
eodash_catalog-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
+
eodash_catalog-0.1.5.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
|
|
13
|
+
eodash_catalog-0.1.5.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
|
|
14
|
+
eodash_catalog-0.1.5.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
eodash_catalog/__about__.py,sha256=QlH-_ow6dHwd6vmlNbfNzxEFupl7vVJuWvteKR1t9YU,137
|
|
2
|
-
eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
|
|
3
|
-
eodash_catalog/duration.py,sha256=B6XOZfvNU7SuqpxuVtT1kNKODoOQJXDI6mocvA_U1ik,10816
|
|
4
|
-
eodash_catalog/endpoints.py,sha256=RfjwEz9Yo4X1zWnwPC-xqhSy_OphazKv5Edruf8pBOU,40821
|
|
5
|
-
eodash_catalog/generate_indicators.py,sha256=HpnzZDORuwQYlJlhyhOmobNq5hKDUQHPDinaD-Cb6l4,20064
|
|
6
|
-
eodash_catalog/sh_endpoint.py,sha256=XjZsZJ5jfJZLQenSTqUhiUZ5YAu9M9nv2KL1Qv3Be-I,1219
|
|
7
|
-
eodash_catalog/stac_handling.py,sha256=uN4tDkfqZQV6EmhTuMDM3630n-4CRkMuaiOoEwti3iw,18158
|
|
8
|
-
eodash_catalog/thumbnails.py,sha256=qZDcpQe80ki6lEMKYdZtSnnHH0PUpcoXTvU9bYdPlzU,2260
|
|
9
|
-
eodash_catalog/utils.py,sha256=mPyt74jEaL0CgyxjnnxW3spomoC8WIfIHi0oCS39d_E,13694
|
|
10
|
-
eodash_catalog-0.1.3.dist-info/METADATA,sha256=0fV3ZMCZmVeK67FDsLrTC_dUpJYJ1HiFvCe6Co6_AZM,3158
|
|
11
|
-
eodash_catalog-0.1.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
12
|
-
eodash_catalog-0.1.3.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
|
|
13
|
-
eodash_catalog-0.1.3.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
|
|
14
|
-
eodash_catalog-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|