mysociety / mapit

A web service to map postcodes to administrative boundaries and more
Other
269 stars 88 forks source link

possibly add an extra_types parameter to MapIt queries #74

Open mhl opened 11 years ago

mhl commented 11 years ago

(This came up in a discussion in IRC of possibly adding NHS CCG areas to MapIt UK - there are shapefiles available.)

One of the things that discourages us from adding new, potentially useful dataset to MapIt UK, is that the time for point-in-polygon lookups goes up when new datasets are added. For smaller polygons this should not make much of a difference, but with large polygons (e.g. Police areas) @JennyD and I did some timings and found that the existence of those polygons in the database slowed down any unrestricted lookup by about 17%.

It's always possible to restrict the types of the search (with the ?type=) query parameter, but @jacksonj04 suggested that one could also add a converse option: have some non-default types that could be searched. For example, some types might not be searched by default, but would be if included in an extra_types parameter specified them.

I think this is something worth considering - my biggest concern would be that when people evaluate MapIt, I guess they typically do it by searching for a particular point, and seeing what areas are returned, so the extra_types areas wouldn't be so obviously discoverable.

symroe commented 8 years ago

Adding to this – police force IDs is something that Democracy Club will need for the 2016 elections.

Given the performance hit that @mhl pointed out above I wonder:

  1. If advances in PostGIS and general hardware speed in the last couple of years might mitigate the 17% slow down seen or
  2. If DC should host it's own install of MaPit that only contains shapes for elections that we care about (i.e., not parishes, yet).

Given that we'll want this quick soon (on the timeline of this 2 year old issue), option 2 might be best for us.