-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Description
It looks like tilemaker supports points but only points and not multipoints.
Storing points in vector tiles is highly inefficient due to the heavy vector tile message encoding that's needed to store two numbers for a point. I found a historic ticket on this going into more details: mapbox/vector-tile-spec#35
It would be great if tilemaker could write out MultiPoints where possible to
- make tiles smaller where many points are used, and
- to improve decoding and rendering efficiency in clients such as maplibre
For MultiPoints the vector tile geometry type is Point with multiple MoveTo commands.
Vector tile spec on MultiPoints
- https://github.com/mapbox/vector-tile-spec/tree/5330dfc6ba2d5f8c8278c2c4f56fff2c7dee1dbd/2.1#4342-point-geometry-type
- https://github.com/mapbox/vector-tile-spec/tree/5330dfc6ba2d5f8c8278c2c4f56fff2c7dee1dbd/2.1#4352-example-multi-point
The vector tile decoding library used e.g. in Maplibre
MultiPoint read and write support in vtzero
- https://github.com/mapbox/vtzero/blob/67f934ee9aa44b923b5d0bc2bc87448900051a57/include/vtzero/geometry.hpp#L253-L278
- https://github.com/mapbox/vtzero/blob/67f934ee9aa44b923b5d0bc2bc87448900051a57/include/vtzero/geometry.hpp#L227-L251
- https://github.com/mapbox/vtzero/blob/67f934ee9aa44b923b5d0bc2bc87448900051a57/test/t/test_geometry_point.cpp#L59-L64
MultiPoint writing usage example in vtzero
Tilemaker writing out a point
Lines 278 to 286 in 9e6f7d5
if (oo.oo.geomType == POINT_) { vtzero::point_feature_builder fbuilder{vtLayer}; if (sharedData.config.includeID && oo.id) fbuilder.set_id(oo.id); LatpLon pos = source->buildNodeGeometry(oo.oo.objectID, bbox); pair<int,int> xy = bbox.scaleLatpLon(pos.latp/10000000.0, pos.lon/10000000.0); fbuilder.add_point(xy.first, xy.second); oo.oo.writeAttributes(attributeStore, fbuilder, zoom); fbuilder.commit();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels