-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Why
As of today, using MVT, when a geometry overlays several tiles, it gets split into pieces, one per tile. Client-side, the visual effect is nowhere to be found as
It does that by rendering the polygon larger than the tile size and then clipping it,
so it's not really merging but more of drawing side by side.
But, if any feature extends across several tiles:
- Labels: there would be a label per feature portion
queryRenderedFeaturesandquerySourceFeaturesboth return not features, but features' parts, so you need to postprocess the results to get the right features count
Because features come from tiled vector data or GeoJSON data that is converted to tiles internally,
feature geometries may be split or duplicated across tile boundaries and, as a result, features may
appear multiple times in query results. For example, suppose there is a highway running through
the bounding rectangle of a query. The results of the query will be those parts of the highway that
lie within the map tiles covering the bounding rectangle, even if the highway extends into other tiles,
and the portion of the highway within each map tile will be returned as a separate feature. Similarly,
a point feature near a tile boundary may appear in multiple tiles due to tile buffering.
- Export: there is no way to retrieve the data in the viewport for a given layer, as the features' geometries make no sense without further processing
Proposal
- Store a geometry ID per feature's geometry, to take into account multigeometry features, just the ordinal of the geometry in the original feature
- Store a vertex ID per geometry's vertex, just the ordinal of the vertex in the original geometry
- outer rings and lines: vertex_id >0
- inner rings: vertex_id < 0. TBD, but it would be like
-1000000 * hole_ordinal - vertex_ordinal(so we can take into account several holes) - "synthetic" vertices generated at feature-tile intersection:
vertex_id = 0(so they can be discarded later)
This way, the original geometries can be rebuilt later (at current LoD, indeed)
tordans
Metadata
Metadata
Assignees
Labels
No labels