mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Refactor coordinate processing into Polygons class
We have a bunch of stuff for doing lat/long transformation in the `BroadcastMessage` class. This is not a good separation of concerns, now that we have a separate class for dealing with polygons and coordinates.
This commit is contained in:
@@ -18,13 +18,19 @@ def test_simple_polygons(fake_uuid):
|
||||
))
|
||||
|
||||
assert [
|
||||
[len(polygon) for polygon in broadcast_message.polygons],
|
||||
[len(polygon) for polygon in broadcast_message.simple_polygons],
|
||||
[
|
||||
len(polygon)
|
||||
for polygon in broadcast_message.polygons.as_coordinate_pairs_lat_long
|
||||
],
|
||||
[
|
||||
len(polygon)
|
||||
for polygon in broadcast_message.simple_polygons.as_coordinate_pairs_lat_long
|
||||
],
|
||||
] == [
|
||||
# One polygon for each area
|
||||
[27, 31],
|
||||
# Because the areas are close to each other, the simplification
|
||||
# and unioning process results in a single polygon with fewer
|
||||
# total coordinates
|
||||
[34],
|
||||
[55],
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user