From f018f47182876215f8b767eabf8c3e8cc45c476f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 19 Dec 2016 18:07:04 +0100 Subject: [PATCH] fix bug to correctly determine which locations lie inside each other --- src/c3nav/mapdata/models/locations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c3nav/mapdata/models/locations.py b/src/c3nav/mapdata/models/locations.py index 22e93732..4504b750 100644 --- a/src/c3nav/mapdata/models/locations.py +++ b/src/c3nav/mapdata/models/locations.py @@ -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