mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 06:53:11 -04:00
Add comment explaining phone counting strategy
This commit is contained in:
@@ -184,10 +184,17 @@ class BroadcastMessage(JSONModel):
|
|||||||
estimated_area = self.simple_polygons.estimated_area
|
estimated_area = self.simple_polygons.estimated_area
|
||||||
|
|
||||||
if estimated_area > ESTIMATED_AREA_OF_LARGEST_UK_COUNTY:
|
if estimated_area > ESTIMATED_AREA_OF_LARGEST_UK_COUNTY:
|
||||||
|
# For large areas, use a naïve but computationally less
|
||||||
|
# expensive way of counting the number of phones in the
|
||||||
|
# bleed area
|
||||||
count = self.count_of_phones * (
|
count = self.count_of_phones * (
|
||||||
self.simple_polygons_with_bleed.estimated_area / estimated_area
|
self.simple_polygons_with_bleed.estimated_area / estimated_area
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
# For smaller areas, where the computation can be done in
|
||||||
|
# a second or less (approximately) calculate the number of
|
||||||
|
# phones based on the ammount of overlap with areas for
|
||||||
|
# which we have population data
|
||||||
count = CustomBroadcastArea.from_polygon_objects(
|
count = CustomBroadcastArea.from_polygon_objects(
|
||||||
self.simple_polygons_with_bleed
|
self.simple_polygons_with_bleed
|
||||||
).count_of_phones
|
).count_of_phones
|
||||||
|
|||||||
Reference in New Issue
Block a user