Skip to content

Commit d99f144

Browse files
Merge pull request #573 from EOxServer/discard-invalid-footprints
Raise exception on invalid footprint
2 parents 9c8fa74 + 28ba466 commit d99f144

File tree

1 file changed

+7
-3
lines changed
  • eoxserver/resources/coverages/registration

1 file changed

+7
-3
lines changed

eoxserver/resources/coverages/registration/stac.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,13 @@ def register_stac_product(stac_item, product_type=None, storage=None,
355355
for name in field_name:
356356
metadata[name] = value
357357

358-
# read footprint from metadata if it was not already defined
359-
footprint = footprint or metadata.get('footprint')
360-
358+
if not footprint:
359+
# read footprint from metadata if it was not already defined
360+
footprint = metadata.get('footprint')
361+
if footprint:
362+
footprint = GEOSGeometry(footprint)
363+
if footprint and not footprint.valid:
364+
raise RegistrationError(f'Footprint is not valid {footprint}, reason {footprint.valid_reason}')
361365
if simplify_footprint_tolerance is not None and footprint:
362366
footprint = footprint.simplify(
363367
simplify_footprint_tolerance, preserve_topology=True

0 commit comments

Comments
 (0)