Commit Graph

6 Commits

Author SHA1 Message Date
Ben Thorner
4bae4eec6c Start sending aggregate area names to API
The aggregate names don't need to be sorted, but it helps to do
this for the tests, since the implementation of sets may not be
stable between machines and lead to sporadic test failures.

I did also toy with sorting granular area names so they have a
similar ordering, but this would take them out-of-order with IDs
and really the important thing is that the ordering is stable.
2021-09-02 12:59:18 +01:00
Ben Thorner
a94291d5a4 Clarify comments for aggregation algorithm
In response to [1] and [2].

[1]: https://github.com/alphagov/notifications-admin/pull/4003#discussion_r695919270
[2]: https://github.com/alphagov/notifications-admin/pull/4003#discussion_r695920213
2021-09-02 12:59:17 +01:00
Ben Thorner
de804805ac Refactor logic to identify types of areas
I did consider whether to store this explicitly in the SQLite DB,
but this is less effort for now and we can always switch to that
more robust approach in future if we need to.
2021-09-02 12:59:16 +01:00
Ben Thorner
bcfa21428f Support aggregating local authority clusters
This applies some heuristics to try and keep the overall list of
areas short when many are selected in the same wider area.

Currently we only have relationship information between upper and
lower tier local authorities, so we can't / won't aggregate up to
Greater London (it's own special thing) or whole countries.
2021-09-02 12:59:13 +01:00
Ben Thorner
2d912cef42 Support area aggregation for custom polygons 2021-09-02 12:55:53 +01:00
Ben Thorner
a210d87dee Add function method to aggregate areas
This is standalone for now - we'll plumb it in later.
2021-09-02 12:55:52 +01:00