fix bug to correctly determine which locations lie inside each other

This commit is contained in:
Laura Klünder 2016-12-19 18:07:04 +01:00
parent 69d6d16d1b
commit f018f47182

View file

@ -150,7 +150,7 @@ class AreaLocation(LocationModelMixin, GeometryMapItemWithLevel):
for location_type in reversed(self.LOCATION_TYPES_ORDER[:area_location_i]):
for arealocation in AreaLocation.objects.filter(location_type=location_type, level=self.level):
intersection_area = arealocation.geometry.intersection(self.geometry).area
if intersection_area and my_area / intersection_area > 0.99:
if intersection_area and intersection_area / my_area > 0.99:
in_areas.append(arealocation)
return in_areas