Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise exception on invalid footprint #573

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions eoxserver/resources/coverages/registration/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,13 @@ def register_stac_product(stac_item, product_type=None, storage=None,
for name in field_name:
metadata[name] = value

# read footprint from metadata if it was not already defined
footprint = footprint or metadata.get('footprint')

if not footprint:
# read footprint from metadata if it was not already defined
footprint = metadata.get('footprint')
if footprint:
footprint = GEOSGeometry(footprint)
if footprint and not footprint.valid:
raise RegistrationError(f'Footprint is not valid {footprint}, reason {footprint.valid_reason}')
if simplify_footprint_tolerance is not None and footprint:
footprint = footprint.simplify(
simplify_footprint_tolerance, preserve_topology=True
Expand Down
Loading