* fixes bug where rectangular geometry results in an error during geometry complexity calculation
This commit is contained in:
mpeltriaux 2024-02-29 18:37:53 +01:00
parent a57d609420
commit 5a71ad7187

View File

@ -364,7 +364,13 @@ class Geometry(BaseResource):
geom_envelope = self.geom.envelope
diff = geom_envelope - self.geom
complexity_factor = 1 - self.geom.area / diff.area
if diff.area == 0:
ratio = 1
else:
ratio = self.geom.area / diff.area
complexity_factor = 1 - ratio
return complexity_factor