Technology1 min read

Protomaps: Self-hosting map tiles has gotten cheap and easy

By · Published by Everything Blog

In short

The Protomaps ecosystem enables organizations to store an entire 139GB global map archive on commodity storage and deliver it via edge-aware networks. Rather than paying commercial rates of $5 per 1,000 loads, operators can achieve costs around $0.05 per 1,000 sessions by only retrieving necessary byte ranges. Setup requires syncing data archives using CLI tools like rclone and implementing CDN-level caching with bandwidth limits. Front-end integration is then completed using the MapLibre GL library alongside the dedicated PMTiles npm package.

Key points

  • The PMTiles archive format uses targeted HTTP Range requests to avoid running expensive,…: The PMTiles archive format uses targeted HTTP Range requests to avoid running expensive, dedicated map tile servers.
  • Operators can deploy daily global builds or customized geographic extractions using stand…: Operators can deploy daily global builds or customized geographic extractions using standard S3 tools like rclone.
  • Edge functions and pull zone CDNs protect infrastructure through CORS restrictions and ba…: Edge functions and pull zone CDNs protect infrastructure through CORS restrictions and bandwidth throttling on map files.

Sources checked by our analysis pipeline: 1

PMTiles is a tile format which works via HTTP Range requests and can be deployed as a single file to a storage bucket.

I came across Protomaps in research for my latest project, Mapboard.1 For most non-commercial projects, commercial APIs become prohibitively expensive if you ever go viral (Mapbox, for instance, charges $5 per 1k map loads once you’ve exhausted the free tier).

PMTiles, part of the Protomaps ecosystem, is a tile format that ships in a single file, accessible via Range requests, and is thus extremely portable and easy to deploy. For CDNs that support caching Range requests of large files, it requires no effort besides down- and uploading it to storage. For others, like Cloudflare, you can utilize an edge function to translate between the traditional x/y/z URL path and Range requests.

Getting some Maps

If all you want is the world map, getting it is as simple as going to the build page and downloading the latest daily build.

However, more fun can be had with the CLI. For example, you can extract data for only a…

Technology