mapbox / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
2.73k stars 432 forks source link

PM-Tiles vs PBF-Tiles Comparison #972

Open koufopoulosf opened 1 year ago

koufopoulosf commented 1 year ago

Hello all,

I am making this issue, as I would like your valuable opinion on the following matter.

So far, for making a basemap (not relying on a 3rd party API), we have to worry about provisioning a server, scaling it, maintaning it, and all the fun that comes with it (like in the case of MBTiles). However, there are two alternative ways, that I would consider.

One is to use protomaps, the so called PMTiles, which essentially is a simple blob that the frontend will download (only desired parts) and render directly in the browser.

The other suggestion would be to use tippecanoe with the --output-to-directory flag to output the individual .pbf tiles instead of a single MBTiles file. These tiles can then be hosted on something like S3 and your map-rendering client can query the necessary tiles, no server required.

So my question would be:

Has anyone experience with both of these methods for deploying a scalable basemap and/or is there any other suggestion that could be considered efficient in terms of serving a basemap without the need of a server?

Thanks in advance for your valuable time.

Best Regards,

Filippos

e-n-f commented 1 year ago

The tradeoff is that storing tiles to individual S3 files can be very slow, but access to them once they are stored is very fast; storing an archive of tiles as a single file on S3 is very fast but access to tiles from that archive is then somewhat slower.

Mapbox stores tiles as individual files on S3. Felt stores a single pmtiles file on S3 and uses an AWS lambda to serve tiles from that archive using range requests.

koufopoulosf commented 1 year ago

@e-n-f Thanks for your detailed reply! I was wondering, can we make user download the map locally on his phone/or web browser cache and never have to access them again from our webserver / S3 / tileserver / whatever? I am really interested in such a solution. I mean, the PMTiles size I have is ~350MB, so if it was a mobile app, it would be a normal sized app.