Skip to content

Commit

Permalink
fix: add safeguard for no footprint whatsoever
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed May 31, 2024
1 parent a021b89 commit 28ba466
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eoxserver/resources/coverages/registration/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,12 @@ 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 GEOSGeometry(metadata.get('footprint'))
if not footprint.valid:
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(
Expand Down

0 comments on commit 28ba466

Please sign in to comment.