mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Bump utils
This new version of utils implements the transformation of our polygons to a Cartesian plane. In other words, it converts them from being defined in spherical degrees to metres. For the API this means our simplification will be slightly more accurate.
This commit is contained in:
@@ -44,7 +44,10 @@ def create_broadcast():
|
||||
_validate_template(broadcast_json)
|
||||
|
||||
polygons = Polygons(list(chain.from_iterable((
|
||||
area['polygons'] for area in broadcast_json['areas']
|
||||
[
|
||||
[[y, x] for x, y in polygon]
|
||||
for polygon in area['polygons']
|
||||
] for area in broadcast_json['areas']
|
||||
))))
|
||||
|
||||
broadcast_message = BroadcastMessage(
|
||||
@@ -56,7 +59,7 @@ def create_broadcast():
|
||||
'names': [
|
||||
area['name'] for area in broadcast_json['areas']
|
||||
],
|
||||
'simple_polygons': polygons.smooth.simplify.as_coordinate_pairs_long_lat,
|
||||
'simple_polygons': polygons.smooth.simplify.as_coordinate_pairs_lat_long,
|
||||
},
|
||||
status=BroadcastStatusType.PENDING_APPROVAL,
|
||||
api_key_id=api_user.id,
|
||||
|
||||
Reference in New Issue
Block a user