Skip to content

Commit

Permalink
Merge pull request #573 from EOxServer/discard-invalid-footprints
Browse files Browse the repository at this point in the history
Raise exception on invalid footprint
  • Loading branch information
constantinius authored Jun 3, 2024
2 parents 9c8fa74 + 28ba466 commit d99f144
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit d99f144

Please sign in to comment.