mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 04:58:24 -04:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user