-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] increase padding in CollisionIndex for MapMode::Tile #15880
Conversation
Thanks for putting this up as a PR @ansis. As a prerequisite to reviewing, on my end, I just tried to build locally to check the test coverage. But 1) I'm not seeing a way to see test coverage locally - is there an established best practice here? and 2) I hit #15881 so currently I'm blocked on running the unit tests: is there an existing test for this behavior or do we need to add one? |
@ansis is it fine to be merged? |
@pozdnyakov do you know the answer to this? I've finally gotten my local build working, so unless there is already a way to do this, I'm planning on trying to get local coverage generation working. The reason I'm interested in local coverage is for branch coverage details. It seems essential to me that we ensure there is there is test coverage for both So, I do not think this is not ready to merge yet. Before merging we should have confidence that the logic in this PR is tested under both |
@springmeyer sorry for missing your question, IMO a render test could suffice for verifying this PR's intended behavior. Actually, render tests provide even better QA than unit tests. Our test runner supports tile mode (e.g. pls see mapbox/mapbox-gl-js#8899) |
Thanks @pozdnyakov - sounds good then to merge this if it has a render test covering it. Does it? Also, I never found time to run coverage locally, but I'll create a ticket documenting my setup if I ever get around to it. |
Increase the CollisionIndex's padding so that more of a tile's data gets considered when checking for collisions. This should fix clipped variable placement text labels.
cea1aa6
to
f94d2d4
Compare
f94d2d4
to
d733f53
Compare
@ansis does this have a render test covering it? |
Bump @ansis @pozdnyakov @tmpsantos - does this code have render-test coverage or not? |
The existing |
When rendering image tiles using MapMode::Tile we need to avoid clipped labels at tile boundaries. Clipped labels happen when one tile decides a label can be shown and the other tile decides that it collides with something and needs to be hidden.
When rendering overscaled image tiles (rendering z17 image tiles for a vector tile source that only goes up to z16) we should use all the data from the tile instead of just the data that fits within the image tile.
This increases the padding to 1024 for MapMode::Tile which should be enough to completely include all the data two zoom levels past the data source's max zoom level. Beyond that, 1024 should be enough of a padding to make clipped labels unlikely.
An alternative would be to calculate the max zoom levels of all the sources used and dynamically set the padding on all sides but increasing the constant seems as good and less complex.