Add method to get wards for custom polygon

This will be used as part of the area aggregation in the following
commits.
This commit is contained in:
Ben Thorner
2021-08-24 14:36:14 +01:00
parent 51b786e544
commit f96b75b401
3 changed files with 35 additions and 0 deletions

View File

@@ -162,6 +162,13 @@ class CustomBroadcastArea(BaseBroadcastArea):
simple_polygons = polygons
@cached_property
def overlapping_electoral_wards(self):
return [
area for area in self.nearby_electoral_wards
if area.simple_polygons.intersects(self.polygons)
]
@cached_property
def nearby_electoral_wards(self):
if not self.polygons: