paulmach / orb

Types and utilities for working with 2d geometry in Golang
MIT License
886 stars 103 forks source link

How to process the result of encoding/mvt #121

Closed ccarstens closed 1 year ago

ccarstens commented 1 year ago

Thank you for creating orb and the mvt encoder!

My team is currently currently looking for the best way to process and use Mapbox Tilesets for our use case. @paulmach could you give me some guidance on how to use the result of the mvt marshaller?

When using the output of tippecanoe we can upload the result to Mapbox directly. When saving the result of mvt.Marshal() as mytileset.mbtiles and uploading it, we're receiving an error from Mapbox Unknown File Type.

Is this direct upload supported? Or is the result only meant to be self hosted?

paulmach commented 1 year ago

a *.mbtiles file represents a collection of files/tiles. It is an sqlite file with a table that has x,y,z,data columns (see https://github.com/mapbox/mbtiles-spec). You can rename the file to *.sql and open it in an sqlite viewing app. The data part is what you get from mvt.Marshal().

ccarstens commented 1 year ago

Hi @paulmach, thank you for your reply! What's the use case of the mvt.Marshal() if it's just the data portion and can't be used with Mapbox directly?

paulmach commented 1 year ago

mvt.Marshal() is the data for an individual tile. tippecanoe creates mbtile files which are a collection of files. This library does not provide the tile -> tile set part.