mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Update utils to do linear transformation of polygons
Brings in https://github.com/alphagov/notifications-utils/pull/889/files At the moment, we are not doing any transformation of features before applying geometric algorithms to them. This is, in effect, assuming that the earth is flat. 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 admin app this means we need to convert places where the code expects things to be measured in degrees to work in metres instead.
This commit is contained in:
@@ -221,7 +221,8 @@ class BroadcastMessage(JSONModel):
|
||||
polygons = Polygons(
|
||||
list(itertools.chain(*(
|
||||
getattr(area, area_attribute) for area in self.areas
|
||||
)))
|
||||
))),
|
||||
utm_crs=self.areas[0].polygons.utm_polygons.utm_crs,
|
||||
)
|
||||
if area_attribute != 'polygons' and len(self.areas) > 1:
|
||||
# We’re combining simplified polygons from multiple areas so we
|
||||
|
||||
Reference in New Issue
Block a user