eodash_catalog 0.1.2__tar.gz → 0.1.4__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.
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.bumpversion.cfg +1 -1
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/PKG-INFO +4 -2
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/__about__.py +1 -1
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/generate_indicators.py +4 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/stac_handling.py +66 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/utils.py +7 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.github/workflows/ci.yml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.github/workflows/python-publish.yml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.gitignore +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.vscode/extensions.json +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/.vscode/settings.json +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/LICENSE.txt +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/README.md +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/pyproject.toml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/requirements.txt +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/ruff.toml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/__init__.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/duration.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/endpoints.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/sh_endpoint.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/src/eodash_catalog/thumbnails.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/__init__.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/test-data/regional_forecast.json +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/test_generate.py +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-catalogs/testing.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_CROPOMAT1.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_see_solar_energy.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_tif_demo_1.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_tif_demo_2.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_wms_no_time.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-indicators/test_indicator.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-layers/baselayers.yaml +0 -0
- {eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-layers/overlays.yaml +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: eodash_catalog
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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-Expression: MIT
|
|
10
|
+
License-File: LICENSE.txt
|
|
9
11
|
Classifier: Development Status :: 4 - Beta
|
|
10
12
|
Classifier: Programming Language :: Python
|
|
11
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -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
|
)
|
|
@@ -133,6 +134,7 @@ def extract_indicator_info(parent_collection: Collection):
|
|
|
133
134
|
"sensor",
|
|
134
135
|
"cities",
|
|
135
136
|
"countries",
|
|
137
|
+
"thumbnail",
|
|
136
138
|
]
|
|
137
139
|
summaries: dict[str, Any] = {}
|
|
138
140
|
for key in to_extract:
|
|
@@ -190,6 +192,7 @@ def process_indicator_file(
|
|
|
190
192
|
parent_indicator.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
|
|
191
193
|
# extract collection information and add it to summary indicator level
|
|
192
194
|
extract_indicator_info(parent_indicator)
|
|
195
|
+
add_process_info(parent_indicator, catalog_config, indicator_config)
|
|
193
196
|
# add baselayer and overview information to indicator collection
|
|
194
197
|
add_base_overlay_info(parent_indicator, catalog_config, indicator_config)
|
|
195
198
|
add_to_catalog(parent_indicator, catalog, {}, indicator_config)
|
|
@@ -338,6 +341,7 @@ def process_collection_file(
|
|
|
338
341
|
parent_collection.add_links(links)
|
|
339
342
|
|
|
340
343
|
add_collection_information(catalog_config, parent_collection, collection_config)
|
|
344
|
+
add_process_info(catalog_config, parent_collection, collection_config)
|
|
341
345
|
parent_collection.update_extent_from_items()
|
|
342
346
|
# Add bbox extents from children
|
|
343
347
|
for c_child in parent_collection.get_children():
|
|
@@ -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],
|
|
@@ -297,6 +318,10 @@ def add_collection_information(
|
|
|
297
318
|
roles=["thumbnail"],
|
|
298
319
|
),
|
|
299
320
|
)
|
|
321
|
+
# Bubble up thumbnail to extra fields
|
|
322
|
+
collection.extra_fields["thumbnail"] = (
|
|
323
|
+
f'{catalog_config["assets_endpoint"]}/' f'{collection_config["Image"]}'
|
|
324
|
+
)
|
|
300
325
|
# Add extra fields to collection if available
|
|
301
326
|
add_extra_fields(collection, collection_config)
|
|
302
327
|
|
|
@@ -321,6 +346,47 @@ def add_collection_information(
|
|
|
321
346
|
collection.extra_fields["eox:colorlegend"] = collection_config["Colorlegend"]
|
|
322
347
|
|
|
323
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"], resource["Database"], query_string
|
|
380
|
+
),
|
|
381
|
+
media_type="application/json",
|
|
382
|
+
extra_fields={
|
|
383
|
+
"method": "GET",
|
|
384
|
+
"id": resource["CollectionId"],
|
|
385
|
+
},
|
|
386
|
+
)
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
|
|
324
390
|
def add_base_overlay_info(
|
|
325
391
|
collection: Collection, catalog_config: dict, collection_config: dict
|
|
326
392
|
) -> None:
|
|
@@ -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}'
|
|
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
|
|
File without changes
|
{eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_see_solar_energy.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_tif_demo_1.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_tif_demo_2.yaml
RENAMED
|
File without changes
|
{eodash_catalog-0.1.2 → eodash_catalog-0.1.4}/tests/testing-collections/test_wms_no_time.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|