Improve country label placement by splitting #4616
Merged
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.
By splitting MPs into polygons, taking the largest, and finding a point in 4326 we get better points for placing labels. 4326 does distort the placement, but it does so in a way that results in better results for most countries.
When monitoring for slow queries, this query does not take significant time compared to other layers. I have some upcoming work that will improve the other queries, as some of them are quite slow on low zoom.
I am making this change for countries only because
Fixes #4241
For the images, left is the tile.osm.org deployment, right is this PR
From my tests, I have a geojson with all the country labels computed this way, because this PR is easiest to test with a full planet import.
point_4326.zip