Skip to content

Commit

Permalink
Merge branch 'main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
baloola committed Jun 14, 2024
2 parents 3f7ab6e + b7d6ca8 commit e064f09
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 1,258 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Contents of this space:

As data ingest is tightly connected with metadata management, use of data, etc., consider also these related spaces:

- [metadata-editor WebGUI](https://catalog-editor.eoxhub.fairicube.eu/): to provide and edit metadata to be shown in the [data catalog (STAC-fastapi)](https://catalog.eoxhub.fairicube.eu/?.language=en)

- [resource-metadata](https://github.com/FAIRiCUBE/resource-metadata): in addition to the issues providing metadata for resources, also used to discuss technical details on resource metadata
- [Fairicube Hub](https://github.com/FAIRiCUBE/FAIRiCUBE-Hub-issue-tracker): for general FAIRiCUBE topics

Expand Down
23 changes: 14 additions & 9 deletions stac/stac-generator/test/validator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pystac
import pytest
import os
import json

from typing import Any


Expand Down Expand Up @@ -43,16 +45,16 @@ def validate_item(item: pystac.item.Item):
assert "y" in item.properties["cube:dimensions"].keys(), "No y dimension in the stac item"
x = item.properties["cube:dimensions"]["x"]
y = item.properties["cube:dimensions"]["y"]
assert "step" in x.keys() and x["step"] is not None, "No x dimensions in the stac item"
assert "step" in x.keys() and x["step"] is not None, "No step in the x dimension"
assert isinstance(float(x["step"]), float), "x step must be float"
assert "step" in y.keys()and y["step"] is not None, "No y dimensions in the stac item"
assert "step" in y.keys()and y["step"] is not None, "No step in the x dimension"
assert isinstance(float(y["step"]), float), "y step must be float"

# Units of Measurement
assert "unit_of_measure" in x.keys(), "No unit in x dimensions"
assert isinstance(x["unit_of_measure"], str), "x dimension unit_of_measure must be a string"
assert "unit_of_measure" in y.keys(), "No unit in y dimensions"
assert isinstance(y["unit_of_measure"], str), "y dimension unit_of_measure must be a string"
assert "unit" in x.keys(), "No unit in x dimensions"
assert isinstance(x["unit"], str), "x dimension unit must be a string"
assert "unit" in y.keys(), "No unit in y dimensions"
assert isinstance(y["unit"], str), "y dimension unit must be a string"

# Horizontal CRS
assert "reference_system" in x.keys(), "No reference_system in x dimensions"
Expand All @@ -63,7 +65,7 @@ def validate_item(item: pystac.item.Item):
# Temporal
assert "t" in item.properties["cube:dimensions"].keys() or "time" in item.properties["cube:dimensions"].keys()
time = dict()
if "t" in item.properties["cube:dimensions"].keys():
if "t" in item.properties["cube:dimensions"].keys() or "time" in item.properties["cube:dimensions"].keys():
time = item.properties["cube:dimensions"]["t"]
else:
time = item.properties["cube:dimensions"]["time"]
Expand All @@ -75,7 +77,7 @@ def validate_item(item: pystac.item.Item):
assert "step" in time.keys(), "No step in time dimensions"
assert isinstance(time["step"], str), "time's step must be a string"
# Unit of measure
assert isinstance(time["unit_of_measure"], str), "time's unit_of_measure must be a string"
assert isinstance(time["unit"], str), "time's unit must be a string"


# Range Data validation
Expand Down Expand Up @@ -141,7 +143,10 @@ def test_items(dir):
'catalog.json') and f.endswith('.json')]

for item in items:
stac_item = pystac.Item.from_file(os.path.join(dir, item))
item_path = os.path.join(dir, item)

stac_item = pystac.Item.from_file(item_path)

validate_item(stac_item)


Expand Down
153 changes: 0 additions & 153 deletions stac_dist/CLMS_Urban_Atlas/CLMS_Urban_Atlas.json

This file was deleted.

138 changes: 0 additions & 138 deletions stac_dist/LGN/LGN.json

This file was deleted.

Loading

0 comments on commit e064f09

Please sign in to comment.