Use already-transformed polygons wherever possible

Transforming full resolution polygons to linear coordinates is somewhat
expensive. We can make things run faster by:
- looking at `simple_polygons` which have fewer points and are therefore
  faster to transform.
- reusing polygons that have already been transformed where possible
This commit is contained in:
Chris Hill-Scott
2021-08-05 18:38:50 +01:00
parent 6cb326f153
commit 0cf443e9a6
3 changed files with 16 additions and 14 deletions

View File

@@ -88,7 +88,7 @@ class BroadcastMessage(JSONModel):
broadcast_message_id=broadcast_message_id,
))
@property
@cached_property
def areas(self):
if 'ids' in self._dict['areas']:
library_areas = self.get_areas(self.area_ids)