diff options
-rw-r--r-- | src/argaze/AreaOfInterest/AOIFeatures.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/argaze/AreaOfInterest/AOIFeatures.py b/src/argaze/AreaOfInterest/AOIFeatures.py index 065fd64..c2714ca 100644 --- a/src/argaze/AreaOfInterest/AOIFeatures.py +++ b/src/argaze/AreaOfInterest/AOIFeatures.py @@ -17,6 +17,7 @@ __credits__ = [] __copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)" __license__ = "GPLv3" +import logging import json import math from typing import Self @@ -232,6 +233,15 @@ class AreaOfInterest(numpy.ndarray): assert (self.dimension == 2) self_polygon = Polygon(self) + + if not self_polygon.is_valid: + + logging.warning('AreaOfInterest.circle_intersection: AOI polygon is not valid.') + + empty_array = numpy.array([list([])]).astype(numpy.float32).view(AreaOfInterest) + + return empty_array, 0., 0. + args_circle = Point(center).buffer(radius) if self_polygon.intersects(args_circle): |