pelias / wof-admin-lookup

Who's on First Admin Lookup for the Pelias Geocoder
https://pelias.io
MIT License
9 stars 24 forks source link

selectively convert some points to buffered geometries #214

Open missinglink opened 6 years ago

missinglink commented 6 years ago

This PR 'buffers' Point geometries, effectively turning them in to Polygon geometries.

It's currently only enabled in the UK, where the lack of open data is a real problem, resulting in incorrect labels for the numerous small towns, hamlets and neighbourhoods where we don't have polygon data.

The code is configurable, in terms of the buffer radius and which records are selected to be buffered.

This will likely have an effect on RAM, although doing it in the UK only will mitigate that somewhat.

The default radius of 0.02 degrees was selected as it's the same value that Nominatim uses for the same task, although they also have larger radii for larger geographies, I chose the more conservative approach for now. I did some spot checking and 0.02 works pretty well.

We will probably need to couple this PR with a small update to the query logic, in the case where more than one neighbourhood matches. In that case, we should choose the record which has the closer centroid.

missinglink commented 6 years ago

On retrospection, we can probably skip buffering anything that isn't a neighbourhood to save RAM?

orangejulius commented 6 years ago

Could be interesting to try both neighbourhood and other layers.