Skip to content

Support writing MultiPoint into vector tiles #719

@daniel-j-h

Description

@daniel-j-h

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

The vector tile decoding library used e.g. in Maplibre

MultiPoint read and write support in vtzero

MultiPoint writing usage example in vtzero

Tilemaker writing out a point

  • 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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions