I’m using Mapnik + Mapbox nodejs stack. Given two vector tiles (PBFs) for the same location/zoom, with some layers having the same name in both. How do I merge them into one PBF tile – replacing identically named layers in the first tile with the ones from the second tile?
Update:
I found that I can add layers via GeoJson, but it seems awfully inefficient: addGeoJSON does not replace existing layer, but adds a new one (even if the same name already exists), so I have to export each layer to JSON and re-add them to a new tile:
newVectorTile.addGeoJSON(vectorTile.toGeoJSON('water'), 'water');