-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] warn when a geometry exceeds the maximum allowed values #4599
Conversation
|
||
namespace mbgl { | ||
|
||
// the minimum position we can store in the buffers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these constants to the .cpp file, since they're only used there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, done
3428d25
to
418d28e
Compare
@ansis This does not look right. A valid vector tile should have coordinates within [0, extent). The invariant is even enforced by the mapnik-vector-tile writer (Its a Mapbox project that's called mapnik for probably legacy reasons). Since it uses ClipperLib, in practice it actually generates [0, extent]. |
Geometries can (and very often do) extend past the tile boundaries:
https://github.com/mapbox/vector-tile-spec/tree/master/2.1#41-layers The current implementation in mapbox-gl-native only supports geometries that extend a limited distance from the tile edges. This distance is limited by the precision we have for storing positions in the vertex buffers. This adds a warning for when geometries extend past that limit. Eventually we may want to clip geometries instead of warning. |
@ansis Is there any advantage to generating geometries outside the tile boundaries? Is it correct (or not) that everything outside the tile boundary is stenciled out? |
Yes, there are advantages to having this data in the vector tiles. It is correct that everything outside the tile boundary is stenciled out.
|
Thank you very much @ansis for the detailed explanation. |
This warning turned out to be problematic in gl-js (mapbox/mapbox-gl-js#2568), and ultimately not very useful. Let's not bother. |
port mapbox/mapbox-gl-js#2383
👀 @jfirebaugh