selectively convert some points to buffered geometries #214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR 'buffers'
Point
geometries, effectively turning them in toPolygon
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 and0.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.