diff --git a/zonalda/__init__.py b/zonalda/__init__.py index ed4d2f9..78b5a2a 100644 --- a/zonalda/__init__.py +++ b/zonalda/__init__.py @@ -43,11 +43,15 @@ def __getitem__(self, name: str) -> tuple[ zone = zones.iloc[0] district, collecte = None, None districts = self.districts.loc[self.districts.contains(zone.geometry)] + if len(districts) == 0: + districts = self.districts.loc[self.districts.intersects(zone.geometry)] if len(districts) > 1: LOGGER.warning("Plusieurs districts trouvé pour %s: %s", name, districts) if len(districts): district = districts.iloc[0] collectes = self.collectes.loc[self.collectes.contains(zone.geometry)] + if len(collectes) == 0: + collectes = self.collectes.loc[self.collectes.intersects(zone.geometry)] if len(collectes) > 1: LOGGER.warning( "Plusieurs zones de collectes trouvé pour %s: %s", name, collectes