PMTiles

stiltzkin

Explorer
Feb 8, 2022
452
596
Medford
I saw this referenced on Hacker News over the weekend and thought you might find it at least interesting, if you aren't already aware of it.

Intro/demo:

Technical explanation:

Code:

This is a pretty ingenious approach to building low-cost content delivery for map sites. The article has all the details, but in short: this allows you to store your map tiles in a single static file. That property allows you to better exploit low cost commodity cloud storage (e.g. S3) to host your basemaps. Instead of having to upload, manage, and store tens or hundreds of millions of map tiles, you can just store one compressed file, and the client will seamlessly request byte ranges from that file, more like a video codec. This is done in a way that deduplicates tiles and optimizes for panning and zooming, reducing the number of overall requests. Neat stuff.
 
  • Like
Reactions: Boyd

Boyd

Administrator
Staff member
Site Administrator
Jul 31, 2004
9,502
2,765
Ben's Branch, Stephen Creek
Interesting, thanks. Didn't take the time to read much but unless it is explained somewhere else, this system is just for vector tiles:

"Protomaps is built around vector tiles for sharp client-side rendering, customizability, and compatibility"

That would make it useless for me, I don't use vector tiles, only raster imagery. I have some Mapbox vector maps, but don't use this for my own maps. You know, I lost count awhile ago, but believe my own maps are up to over 60 million tiles already. Am planning to increase storage to 2tb soon, so that should double during the coming year. I don't use Amazon. At some point I may look at them again, but I've been using the same small hosting company for over 20 years now. As long as they'll work with me on the cost, I'd rather stay with them instead of further enriching Amazon. ;)
 

stiltzkin

Explorer
Feb 8, 2022
452
596
Medford
Nope, it works for raster tiles as well.

Here's a demo:

It's explained in the docs (and also in the GitHub link above).

And you should be able to use this with just about any hosting provider, it doesn't have to be Amazon. This demo uses Cloudflare R2.
 
Last edited:
Top