> OpenFreeMap lets you display custom maps on your website and apps for free.
> Using our public instance is completely free: there are no limits on the number of map views or requests. There’s no registration, no user database, no API keys, and no cookies. We aim to cover the running costs of our public instance through donations.
> What is the tech stack?
> There is no tile server running; only nginx serving a Btrfs image with 300 million hard-linked files. This was my idea; I haven’t read about anyone else doing this in production, but it works really well.
Seconding the praise for OpenFreeMap. I've been using it for Streeter [0] for the last month or so and it's worked out great.
Self-hosting ended up being relatively cheap and easy too. They publish the whole planet as a single PMTiles file every week, and I just copy that to R2 and serve it through a small Worker, basically the Cloudflare route the article mentions.
The mature best practice in the geospatial industry is a postgis server with R-tree based indexing of every item in space. Its pretty trivial to serve this as dynamic vector tiles (e.g. 'martin') including at different scales/zooms.
Few people store data on a server as tiles though it might be served as tiles. Aside from the added storage size, you dont want to have to update 20 levels tiles every time one piece of data is added or removed.
I think OpenFreeMap and Protomaps shift the complexity from serving tiles to building tiles: the former approach requires a Postgres + PostGIS + Martin + a reverse proxy whereas the latter approach requires nothing but a web server (arguably OpenFreeMap requires a bit more than that, since it uses BTRFS images).
If you are optimising for cost and read-traffic, such as OpenFreeMap, shifting that complexity to a preparation step makes a lot of sense.
Yes and no. Agree openfreemap and protomaps have complexity in their tile building systems which they have to build and maintain, but dont think the postgis approach has difficulty serving them at all - its pretty trivial and low code even if a few systems.
I just think the postgis approach works better at both ends of the scale. For large users its a mature, well maintained (by others) and heavily optimised (again by others) system. For small users the benefit of not having to worry about rebuilding individual tiles especially when data updates is a no brainer.
Openfreemap probably has the use case where its pretty close to comparable (set up for osm data so global, large data, very clear use case and feature set to design for, you can update via cadence, enough of a user base to support development, the sell of it all being "one package" is positive for some users, etc.). Whenever i see protomaps, versatiles, tilemaker, maptiler etc. Ive never seen a major use case I can buy into them for.
Been using it on https://coworkations.com/search since April and it works great. I ditched Google Maps after getting duped into a huge bill by enabling some APIs in their console, moved to MapTiler, then kept hitting their rate limits. OpenFreeMap has been zero issues and zero bill.
We're doing something like this behind Cloudflare R2, same concept of owning the map infra (for privacy and access-control) and reducing load on public infrastructure.
If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface [1]. It seems large tiles (>128M) and some raster formats are failing; plus it would be nice to load from URL there. Will fix that...
(AI warning). ntmaps [2] is a Golang library that lets you use different tile providers, deployable in terminal or browser. ntplaygrounds [3] uses that and nt3d and ntactor to make a city simulation. Data is pulled from OpenStreetMap in those.
It can last forever because they own the hardware, pay very little for network transit because they peer with everyone, and storage is cheap. At Cloudflare scale even super low margins translate to big money that's enough to pay for all fixed costs. The only thing that could end it is a push to extract more profit.
1. The app is a remix app, workers do server-side rendering, so that a vanilla `curl` shows the actual payload, not just a script tag that loads the app.
2. I'm a great big nerd, so I recently added the ability to post reviews/photos/GPX traces to your AT protocol PDS. The app has a Worker cron job that subscribes to Bluesky's Jetstream for events in its namespace, and indexes these into D1 in order to answer certain API calls like "get traces in this area" or "get reviews for this hike". So the app itself isn't the primary source of truth, a person's PDS (which they control) is. The app just maintains a cache/index that can be rebuilt.
Once you get outside Cloudflare's free tier, the Bunny setup in the original post beats it pretty quickly. Cloudflare costs $0.30 (Workers invocations) + $0.36 (R2 class B operations) per million requests. Bunny charges for bandwidth but not per request (!!), so assuming an average of 1kB/request (map vector tiles should be a bit less than this in my experience) that's $0.005-$0.06 per million depending on which region and tier you're serving from.
The real "too good to be true" might be GitHub Actions building a 100GB+ PMTiles file for free
I think PM tiles are quite a bit larger. Just loading at a low zoom level a view of the world triggers requests of ca. 500kB on my site, though that might also overscan a bit or include the file header. From my calculations, for Bunny to be cheaper the avg request should be at most 660kB at $0.01/GB which should probably hold true (I think just the worker invocations alone are already equivalent to 300kB of traffic on Bunny)
Huh yeah you're right, I was off by about 100 orders of magnitude. pmtiles.io shows tile sizes with "Show tile bounds" checked and they're mostly in the 30-100 kB range.
Bunny's volume tier costs $5/TB served, i.e. $1 gets you 2~6.7 million tiles served, probably closer to 3.
But Cloudflare also allows public R2 buckets so we could potentially ignore the Workers cost, i.e. $1 gets you 2.8 million tiles served. I think caching just works in front of R2? So you get significant gains if your visitors are mostly looking at the same areas and not zooming in all the way to their house every time.
So they come out pretty evenly or with Cloudflare a bit on top depending on the scenario. Bunny does has the advantage of easy data replication across regions (I don't know of a good way to achieve this with R2, although D1 has some kind of replication feature in beta).
Both are still far, far cheaper than almost any vector tile subscription I've come across. And, of course, more expensive than self-hosting (at least at the hobbyist level).
When you have a CDN in front of object storage it's not so easy to compare as the origin requests go out in chunks. For caching in front of R2, you need the worker, as Cloudflare only permits file sizes of up to 512MB regardless of the range requested. And then there's the latency difference of working directly with R2 (Protomaps calls out latency up to 500ms and on a previous blog post I measured 300-600ms on HEAD requests against R2[0])
For Cartes.app we used to pay Maptiler. While great, recommanded to start, without client revenue it was impossible to scale, we've hit 150 €/month bills way too fast.
Hence Protomaps. Hosting costs almost nothing.
The main problem though is that once you host your tiles, why not put what you want inside ?
Tune Tilemaker's processing.lua to your envy. Spend hours designing maps and building a Typescrpt dynamic Maplibre style.
yeah, basemaps are small enough to store and host cost effectively, but high res satellite imagery gets big and expensive fast as you go up in zoom level. I built my own satellite mosaic of North America for my app so I can offer users offline access to the tiles and had to stop at z17 because of projected storage requirements. high res global coverage can get you into the hundreds of TB range which is no longer in the "stick it on r2 and serve it with a worker" or "download and upload the entire dataset sequentially over your residential internet" territory
the fun/hard parts of the project weren't really scale dependent, although downloading source imagery and building the tile pyramids did take literally weeks to run. actually, the hardest part was getting demosaicing right, e.g. making the quilt seamless. filtering out cloudy and smokey/hazy tiles while picking alternatives from the same time of year so groundcover & crops are in a consistent growth stage so you don't end up with checkerboard patterns or cloud silhouettes randomly across your map. and there were other problems that came up more or less just because of how & when the satellite took the images that require exposure correction and more filtering
I also have a pelias index with 170M records for search and self-host valhalla for routing. the open source mapping ecosystem has really impressed me the more I learn with each project
I was playing with their elevation data last week. Maptiler provides elevation data as well but it gets expensive quickly with them. We managed to blow through our 50$ limit in two days with them just testing this out. So, we tried out Mapterhorn.
I really like their data set. For self hosting, vector map tiles are small enough that storing it in a bucket won't break the bank. I think you need somewhere around 100-150GB or so for protomaps. A few dollars per month goes a long way. However Mapterhorn's elevation data set is something like 11 TB or so. That's going to cost some money to store somewhere. Satellite imagery is similarly expensive to host. And you typically want both.
There is of course an asymmetric relation with what you store and what you serve. Ideally, you store data for the whole planet. But you probably are only going to serve a tiny portion of it. This favors hosted setups where you pay for what you use via a CDN and share the storage with others. A shared service also relieves you from the burden of having to keep that data up to date. The main issue with that is commercial map services tend to overcharge for more intensive usage to the point where self hosting actually becomes attractive despite this.
The main issue is that the number of requests really goes through the roof if you start getting tiles beyond certain zoom levels, which pushes you into the expensive price tiers. With most providers you pay per request and you can easily generate hundreds of thousands of requests just panning around at low altitude over a map, which means you download lots of small tiles. That's how we hit the Maptiler limits. They have high resolution elevation data and exploring the Alps is a lot of fun. We hit 800K requests per day without any real users using our system even. This was just us playing with the data. We switched to Mapterhorn and cap the zoom level at zl-12 for now. Since it's a free service I want to be a bit mindful of not hammering their service.
I'd be interested in reasonable commercial solutions that won't cost me 300+$ per month that would allow me to remove zoom level limitations. At those price levels, self hosting becomes a possibility of course. Which suggests to me that somebody should be able to undercut that price and still make a decent profit.
yeah, I heard about them for the first time a few weeks ago. they have a fantastic data set just judging with my bare eyes. I built my topo map from terrain tiles on aws + gebco et al for the bathymetry data which is just personal preference (I love me an old globe with the tactile mountains and seafloor)
oh sorry, no I didn't know about that. where are they posting about it? I don't see anything on their website or bluesky. there's an nlnet project page for it but it just links back to their site. I'd love to know what their goals are
if you are looking into self hosting, i highly recommend checking out
https://versatiles.org/
the maintainer seems pretty passionate
> VersaTiles is a completely FLOSS stack for generating, distributing, and using map tiles based on OpenStreetMap data, free of any commercial interests.
VersaTiles is a free and open alternative to commercial map services like Google Maps or Mapbox. It is designed for newsrooms, NGOs, developers, and public institutions who need reliable maps without vendor lock-in. VersaTiles is fully self-hostable, requires no API keys, charges no usage fees, and does not track your users.
Word of warning. I had a client that was behind some corporate anti malware proxy. Turned out it stripped the range header from the request and simply did a request for the entire file. Had to implement a proxy endpoint just for them so they could do classic WMTS style requests insetad.
A common approach that's recommended is to use cloudflare workers as a translation layer from the classic /z/x/y request format to the HTTP range headers. That's what I do on my sites, rather than using the pmtiles protocol directly in MapLibre
I was very grateful to find protomaps recently for a project where I want to allow people to download custom regional subsections of the global map for offline usage.
After evaluating maplibre vs the somewhat-abandonned protomaps-leaflet library, I decided to go with the latter as I don't really need the fancy 3d gpu and custom layers functionality of maplibre. Plus leaflet is releasing a long-awaited v2 right now.
I use Protomaps and absolutely love it. After getting hit with a Google Maps bill that was larger than I ever would have expected, I swapped it out for Protomaps instead and I’ve loved it ever since.
The svg tiles are decent for reverse geocoding too. I've had great success splitting gps routes into segments by pulling location data out of relevant tiles. A lot of the reverse geocoding APIs have pretty restrictive per-second limits and response times in the order of 1-2 seconds. Hosting this in an s3 bucket costs an order of magnitude less than any of the APIs I tried at my scale, with millisecond latency, no request limits and near-flat volume scaling.
map.pathfinderwiki.com runs a fictional setting's world map on PMTiles, with both the mapping data and the website stack open-source:
https://github.com/pf-wikis/mapping (using maplibre-gl-js and some custom Java code to manage layers, tile generation, and PoI collation from the associated MediaWiki)
I’m using (and donating to) OpenFreeMap and using Cloudflare to host custom tiles for my travel time map for Canada, à portée [0] - it’s been so effortless and the tiles are quick to load. No clunky tile server required!
I love protomaps, I have added it to my own hobby project to have a self-hosted fallback for regions (or times) where there are no SwissTopo maps available.
The app will periodically download the configured map regions and store the pmap files [1]. The Go backend then directly serves them to the frontend [2].
Any in particular? That’s pretty cool. I switched my own workflow to Planetiler because Tilemaker had too many bugs and quirks for my liking, but I might be tempted to switch back if it’s that much faster.
Worth noting too that there's been a fair amount of effort to fix generated geometry issues in tilemaker, which was historically the pain point (essentially because tilemaker's geometry operations are based on Boost.Geometry rather than JTS/GEOS, and BG is a bit less developed in this sphere). It's a lot better now than it used to be and there's a few PRs being merged soon which will improve things further.
Deploying this as I am typing this. The problem I have with Mapbox is that there is no way to limit spending. When the public key gets abused, it's a potentially enormous bill.
Yeah, me neither. I opened the link along with several other article links from the front page so it sat idle in a separate private tab waiting for me to get to it and just as I clicked on it MWB popped the warning. I'm using LibreOffice with container tabs and MWB Pro under Win10 Pro. Probably nothing.
You can use the pmtiles:// protocol in Maplibre GL, requires protomaps.js and a few lines of setup [1]
My experience with it is ... ok. It works. But going directly to cloud storage (s3 in my case) is unpredictable latency and neither the browser nor most servers really cache HTTP range requests granularly, so every tile is another high-latency round trip. Not worth it - I ended up putting Martin tile server in front of it.
I assume someone could write a protomaps adapter in WASM with some smart caching? Until then, Standard GET requests are just easier to cache and perform much better in practice. The downside being you have to run a server or statically generate files.
I've had success with using a cache in front of my buckets for great performance. In my case I have raster tiles so they get turned into z/x/y tile filenames and a cloudflare worker pulls that from the full file and caches the result in the region.
For what it's worth I think latency/reliability varies a lot with provider. Bunny Storage has quite good latency in my experience (100-300ms) and their CDN supports Range caching (from my understanding Cloudflare does too they just limit the size of the file regardless of the Range)
we use pmtiles on s3 behind cloudfront, and it seems to work pretty well. maybe not a 100% solution compared to what you'd get from google maps, but good enough that i've got no reason to be looking for another solution.
One thing I really like is that the data is static. This isn't useful for some applications, but for my use, namely blogging about my travels, it's perfect. I wouldn't come back and edit the text or pictures to reflect subsequent events, so why would I edit the map? Being able to take ad hoc snapshots of the map at a point in time is perfect.
Same experience on the routing side. I self-host Valhalla on a cheap VPS for a road-trip planner instead of paying per request for a routing API. The setup takes an afternoon of building tiles and figuring out the config, but after that the cost is flat, and that's what makes a free tier possible at all. Paying per request for routing would have killed the free plan.
For a browser viewer on a different origin, I’d test the actual 206 response and CORS behavior from the deployed page, not just from curl. If the client needs to inspect `Content-Range` or `ETag`, those response headers may need to be exposed; a repeat range request also shows whether the CDN is serving the expected cached slice.
OpenFreeMap is a similar project:
https://openfreemap.org/
> What is OpenFreeMap?
> OpenFreeMap lets you display custom maps on your website and apps for free.
> Using our public instance is completely free: there are no limits on the number of map views or requests. There’s no registration, no user database, no API keys, and no cookies. We aim to cover the running costs of our public instance through donations.
> What is the tech stack?
> There is no tile server running; only nginx serving a Btrfs image with 300 million hard-linked files. This was my idea; I haven’t read about anyone else doing this in production, but it works really well.
Just be aware unlike Protomaps, OpenFreeMap uses OpenMapTiles which has stricter attribution requirements.
You'll also see upselling from MapTiler on the pages you're required to attribute along with upselling in the docs https://openmaptiles.org/docs/host/maptiler-cloud/
OpenFreeMap is amazing. Coincidentally I released a new open source tool that uses that today - demo here: https://lite.datasette.io/?install=datasette-maplibre&url=ht...
Seconding the praise for OpenFreeMap. I've been using it for Streeter [0] for the last month or so and it's worked out great.
Self-hosting ended up being relatively cheap and easy too. They publish the whole planet as a single PMTiles file every week, and I just copy that to R2 and serve it through a small Worker, basically the Cloudflare route the article mentions.
[0] https://streeter.city/
The mature best practice in the geospatial industry is a postgis server with R-tree based indexing of every item in space. Its pretty trivial to serve this as dynamic vector tiles (e.g. 'martin') including at different scales/zooms.
Few people store data on a server as tiles though it might be served as tiles. Aside from the added storage size, you dont want to have to update 20 levels tiles every time one piece of data is added or removed.
I think OpenFreeMap and Protomaps shift the complexity from serving tiles to building tiles: the former approach requires a Postgres + PostGIS + Martin + a reverse proxy whereas the latter approach requires nothing but a web server (arguably OpenFreeMap requires a bit more than that, since it uses BTRFS images).
If you are optimising for cost and read-traffic, such as OpenFreeMap, shifting that complexity to a preparation step makes a lot of sense.
Yes and no. Agree openfreemap and protomaps have complexity in their tile building systems which they have to build and maintain, but dont think the postgis approach has difficulty serving them at all - its pretty trivial and low code even if a few systems.
I just think the postgis approach works better at both ends of the scale. For large users its a mature, well maintained (by others) and heavily optimised (again by others) system. For small users the benefit of not having to worry about rebuilding individual tiles especially when data updates is a no brainer.
Openfreemap probably has the use case where its pretty close to comparable (set up for osm data so global, large data, very clear use case and feature set to design for, you can update via cadence, enough of a user base to support development, the sell of it all being "one package" is positive for some users, etc.). Whenever i see protomaps, versatiles, tilemaker, maptiler etc. Ive never seen a major use case I can buy into them for.
Been using it on https://coworkations.com/search since April and it works great. I ditched Google Maps after getting duped into a huge bill by enabling some APIs in their console, moved to MapTiler, then kept hitting their rate limits. OpenFreeMap has been zero issues and zero bill.
I didn't know they just served it straight from disk, that's pretty cool!
They are not the same; protomaps is for any map dataset whereas OpenFreeMap is just for openstreetmap.
We're doing something like this behind Cloudflare R2, same concept of owning the map infra (for privacy and access-control) and reducing load on public infrastructure.
If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface [1]. It seems large tiles (>128M) and some raster formats are failing; plus it would be nice to load from URL there. Will fix that...
(AI warning). ntmaps [2] is a Golang library that lets you use different tile providers, deployable in terminal or browser. ntplaygrounds [3] uses that and nt3d and ntactor to make a city simulation. Data is pulled from OpenStreetMap in those.
[1] https://nimbleterminal.com/gloss/app.html [2] https://nimbleterminal.com/ntmaps [3] https://nimbleterminal.com/ntplaygrounds
> If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface
The official PMTiles viewer [1, 2, 3] is also pretty good.
[1]: https://pmtiles.io/
[2]: https://github.com/protomaps/PMTiles/tree/main/app
[3]: https://protomaps.com/blog/new-pmtiles-io/
R2 is amazing for this.
Cloudflare, generally, is amazing for this, actually. It serves my personal hiking map for about $2/mo, using R2, D1 and Workers.
Building the map itself is free via GitHub Actions.
It's bonkers how the map world has changed over the last 20 years.
R2 is kind of too good, it makes me nervous about how long such a good thing can last.
It can last forever because they own the hardware, pay very little for network transit because they peer with everyone, and storage is cheap. At Cloudflare scale even super low margins translate to big money that's enough to pay for all fixed costs. The only thing that could end it is a push to extract more profit.
That's mostly for the storage not the bandwidth right?
It's pretty much all storage.
Nice ! Yeah I just built bowmaps.com with this approach of cloudflare for tiles and workers for on the fly vector tiling
Looks good. What does the Bow in bowmaps.com mean?
Company has a product called Arrow so figure it works together.
how are you using D1 and Workers with this?
Two small uses:
1. The app is a remix app, workers do server-side rendering, so that a vanilla `curl` shows the actual payload, not just a script tag that loads the app.
2. I'm a great big nerd, so I recently added the ability to post reviews/photos/GPX traces to your AT protocol PDS. The app has a Worker cron job that subscribes to Bluesky's Jetstream for events in its namespace, and indexes these into D1 in order to answer certain API calls like "get traces in this area" or "get reviews for this hike". So the app itself isn't the primary source of truth, a person's PDS (which they control) is. The app just maintains a cache/index that can be rebuilt.
Once you get outside Cloudflare's free tier, the Bunny setup in the original post beats it pretty quickly. Cloudflare costs $0.30 (Workers invocations) + $0.36 (R2 class B operations) per million requests. Bunny charges for bandwidth but not per request (!!), so assuming an average of 1kB/request (map vector tiles should be a bit less than this in my experience) that's $0.005-$0.06 per million depending on which region and tier you're serving from.
The real "too good to be true" might be GitHub Actions building a 100GB+ PMTiles file for free
I think PM tiles are quite a bit larger. Just loading at a low zoom level a view of the world triggers requests of ca. 500kB on my site, though that might also overscan a bit or include the file header. From my calculations, for Bunny to be cheaper the avg request should be at most 660kB at $0.01/GB which should probably hold true (I think just the worker invocations alone are already equivalent to 300kB of traffic on Bunny)
Huh yeah you're right, I was off by about 100 orders of magnitude. pmtiles.io shows tile sizes with "Show tile bounds" checked and they're mostly in the 30-100 kB range.
Bunny's volume tier costs $5/TB served, i.e. $1 gets you 2~6.7 million tiles served, probably closer to 3.
But Cloudflare also allows public R2 buckets so we could potentially ignore the Workers cost, i.e. $1 gets you 2.8 million tiles served. I think caching just works in front of R2? So you get significant gains if your visitors are mostly looking at the same areas and not zooming in all the way to their house every time.
So they come out pretty evenly or with Cloudflare a bit on top depending on the scenario. Bunny does has the advantage of easy data replication across regions (I don't know of a good way to achieve this with R2, although D1 has some kind of replication feature in beta).
Both are still far, far cheaper than almost any vector tile subscription I've come across. And, of course, more expensive than self-hosting (at least at the hobbyist level).
When you have a CDN in front of object storage it's not so easy to compare as the origin requests go out in chunks. For caching in front of R2, you need the worker, as Cloudflare only permits file sizes of up to 512MB regardless of the range requested. And then there's the latency difference of working directly with R2 (Protomaps calls out latency up to 500ms and on a previous blog post I measured 300-600ms on HEAD requests against R2[0])
[0]: https://bruceroettgers.eu/blog/benchmarking-r2-head-requests...
same, we use pmtiles on R2 for landstats.com parcel map. it's very easy to set up and cheap to serve
and we have a CF worker than turns them into rasters on the fly if that's how people want to get them
For Cartes.app we used to pay Maptiler. While great, recommanded to start, without client revenue it was impossible to scale, we've hit 150 €/month bills way too fast.
Hence Protomaps. Hosting costs almost nothing.
The main problem though is that once you host your tiles, why not put what you want inside ?
Tune Tilemaker's processing.lua to your envy. Spend hours designing maps and building a Typescrpt dynamic Maplibre style.
I think main issue hosting services solve is keeping up the tiles up to date.
Maptiler is pretty good company, maybe they would support the project.
They did not follow our question about pricing for open source :/
We now generate our tiles every week for 2 €, and could soon generate them daily for .5 €
yeah, basemaps are small enough to store and host cost effectively, but high res satellite imagery gets big and expensive fast as you go up in zoom level. I built my own satellite mosaic of North America for my app so I can offer users offline access to the tiles and had to stop at z17 because of projected storage requirements. high res global coverage can get you into the hundreds of TB range which is no longer in the "stick it on r2 and serve it with a worker" or "download and upload the entire dataset sequentially over your residential internet" territory
the fun/hard parts of the project weren't really scale dependent, although downloading source imagery and building the tile pyramids did take literally weeks to run. actually, the hardest part was getting demosaicing right, e.g. making the quilt seamless. filtering out cloudy and smokey/hazy tiles while picking alternatives from the same time of year so groundcover & crops are in a consistent growth stage so you don't end up with checkerboard patterns or cloud silhouettes randomly across your map. and there were other problems that came up more or less just because of how & when the satellite took the images that require exposure correction and more filtering
I also have a pelias index with 170M records for search and self-host valhalla for routing. the open source mapping ecosystem has really impressed me the more I learn with each project
Would be nice if cloudflare/someone would host a multi tb r2 satellite mosaic. Once it's cached it's pretty cheap to serve and everyone could use it.
Not sure satellite data is as freely available as OpenStreetMaps, I thought the imagery is mostly copyrighted/propietary.
True I guess NASA blue marble and other datasets only exist for a few higher zooms.
You can get 10m Sentinel-2 for free but it is going to be a couple of TB too many if you want to host all of it.
Here is a commercial one: https://cloudless.eox.at/preview#map=14.00/-80.77673438/-33....
Have you check Mapterhorn's next project ? Funded by Nlnet.
I was playing with their elevation data last week. Maptiler provides elevation data as well but it gets expensive quickly with them. We managed to blow through our 50$ limit in two days with them just testing this out. So, we tried out Mapterhorn.
I really like their data set. For self hosting, vector map tiles are small enough that storing it in a bucket won't break the bank. I think you need somewhere around 100-150GB or so for protomaps. A few dollars per month goes a long way. However Mapterhorn's elevation data set is something like 11 TB or so. That's going to cost some money to store somewhere. Satellite imagery is similarly expensive to host. And you typically want both.
There is of course an asymmetric relation with what you store and what you serve. Ideally, you store data for the whole planet. But you probably are only going to serve a tiny portion of it. This favors hosted setups where you pay for what you use via a CDN and share the storage with others. A shared service also relieves you from the burden of having to keep that data up to date. The main issue with that is commercial map services tend to overcharge for more intensive usage to the point where self hosting actually becomes attractive despite this.
The main issue is that the number of requests really goes through the roof if you start getting tiles beyond certain zoom levels, which pushes you into the expensive price tiers. With most providers you pay per request and you can easily generate hundreds of thousands of requests just panning around at low altitude over a map, which means you download lots of small tiles. That's how we hit the Maptiler limits. They have high resolution elevation data and exploring the Alps is a lot of fun. We hit 800K requests per day without any real users using our system even. This was just us playing with the data. We switched to Mapterhorn and cap the zoom level at zl-12 for now. Since it's a free service I want to be a bit mindful of not hammering their service.
I'd be interested in reasonable commercial solutions that won't cost me 300+$ per month that would allow me to remove zoom level limitations. At those price levels, self hosting becomes a possibility of course. Which suggests to me that somebody should be able to undercut that price and still make a decent profit.
yeah, I heard about them for the first time a few weeks ago. they have a fantastic data set just judging with my bare eyes. I built my topo map from terrain tiles on aws + gebco et al for the bathymetry data which is just personal preference (I love me an old globe with the tactile mountains and seafloor)
I'm talking about their global satellite dataset project, in works now.
oh sorry, no I didn't know about that. where are they posting about it? I don't see anything on their website or bluesky. there's an nlnet project page for it but it just links back to their site. I'd love to know what their goals are
if you are looking into self hosting, i highly recommend checking out https://versatiles.org/ the maintainer seems pretty passionate
> VersaTiles is a completely FLOSS stack for generating, distributing, and using map tiles based on OpenStreetMap data, free of any commercial interests. VersaTiles is a free and open alternative to commercial map services like Google Maps or Mapbox. It is designed for newsrooms, NGOs, developers, and public institutions who need reliable maps without vendor lock-in. VersaTiles is fully self-hostable, requires no API keys, charges no usage fees, and does not track your users.
Thanks for sharing this. I'll dig into how it differs from protomaps today.
Word of warning. I had a client that was behind some corporate anti malware proxy. Turned out it stripped the range header from the request and simply did a request for the entire file. Had to implement a proxy endpoint just for them so they could do classic WMTS style requests insetad.
A common approach that's recommended is to use cloudflare workers as a translation layer from the classic /z/x/y request format to the HTTP range headers. That's what I do on my sites, rather than using the pmtiles protocol directly in MapLibre
https://docs.protomaps.com/deploy/cloudflare
I'm making a Wikipedia walking game where each card comes in a sealed pack printed with the real streets around where you found it, rendered live.
With Mapbox or Google Maps I wouldn't even have considered building this game. Protomaps made it a no-brainer
Thanks to Brandon and the OSM contributors. This is what made the idea affordable for a side project.
I was very grateful to find protomaps recently for a project where I want to allow people to download custom regional subsections of the global map for offline usage.
After evaluating maplibre vs the somewhat-abandonned protomaps-leaflet library, I decided to go with the latter as I don't really need the fancy 3d gpu and custom layers functionality of maplibre. Plus leaflet is releasing a long-awaited v2 right now.
I use Protomaps and absolutely love it. After getting hit with a Google Maps bill that was larger than I ever would have expected, I swapped it out for Protomaps instead and I’ve loved it ever since.
Dirt cheap to run, theme-able, easy to use.
The svg tiles are decent for reverse geocoding too. I've had great success splitting gps routes into segments by pulling location data out of relevant tiles. A lot of the reverse geocoding APIs have pretty restrictive per-second limits and response times in the order of 1-2 seconds. Hosting this in an s3 bucket costs an order of magnitude less than any of the APIs I tried at my scale, with millisecond latency, no request limits and near-flat volume scaling.
Cloudflare recently improved their support for Range requests: https://blog.cloudflare.com/origin-range-requests/
From my understanding it is still limited by the overall file size though or has this changed too?
https://developers.cloudflare.com/cache/reference/range-requ...
map.pathfinderwiki.com runs a fictional setting's world map on PMTiles, with both the mapping data and the website stack open-source:
https://github.com/pf-wikis/mapping (using maplibre-gl-js and some custom Java code to manage layers, tile generation, and PoI collation from the associated MediaWiki)
https://github.com/pf-wikis/mapping-data (using kart)
I’m using (and donating to) OpenFreeMap and using Cloudflare to host custom tiles for my travel time map for Canada, à portée [0] - it’s been so effortless and the tiles are quick to load. No clunky tile server required!
[0] aportee.ca
I love protomaps, I have added it to my own hobby project to have a self-hosted fallback for regions (or times) where there are no SwissTopo maps available.
The app will periodically download the configured map regions and store the pmap files [1]. The Go backend then directly serves them to the frontend [2].
[1]: https://github.com/jo-m/cartomancer/tree/a02f042173b5ba1a7d9... [2]: https://github.com/jo-m/cartomancer/blob/a02f042173b5ba1a7d9...
Checkout the new PRs submitted to Tilemaker. It appears building the planet could soon take less than 5 minutes.
Any in particular? That’s pretty cool. I switched my own workflow to Planetiler because Tilemaker had too many bugs and quirks for my liking, but I might be tempted to switch back if it’s that much faster.
Worth noting too that there's been a fair amount of effort to fix generated geometry issues in tilemaker, which was historically the pain point (essentially because tilemaker's geometry operations are based on Boost.Geometry rather than JTS/GEOS, and BG is a bit less developed in this sphere). It's a lot better now than it used to be and there's a few PRs being merged soon which will improve things further.
https://github.com/systemed/tilemaker/discussions/977 has running discussion of it.
dktue's branch has all the perf PRs applied to it: https://github.com/dktue/tilemaker/tree/perf/planet-3min
A PMTiles file on a bucket is the only map provider whose worst case is a rounding error.
Deploying this as I am typing this. The problem I have with Mapbox is that there is no way to limit spending. When the public key gets abused, it's a potentially enormous bill.
I self-host protomaps on CloudFlare for my side project: https://github.com/BlueBlazin/lowpolyearth
It costs me something like $2/month iirc, and it made tile querying faster over protomaps' free hosted endpoint.
This is amazing! I also love your BlockViz https://github.com/BlueBlazin/blockviz project. Keep Blazin!
My product safemap.io is hosted on Protomaps. Highly recommend.
I deployed self-hosted protomaps on geocode.xyz and it works like a charm. I wish it had more customization options though ( https://geocode.xyz/415%20C'WEALTH%20AVE%20WEST%20Singapore )
I really loved this post keep going
Thank you :)
I visited the link and Malwarebytes warned of a potentially malicious site:
p - proxy - tp8ez dot bunny dot run
so I closed that window.
What else you got?
It's my API endpoint for Plausible (private website analytics), not sure why it would get flagged
Yeah, me neither. I opened the link along with several other article links from the front page so it sat idle in a separate private tab waiting for me to get to it and just as I clicked on it MWB popped the warning. I'm using LibreOffice with container tabs and MWB Pro under Win10 Pro. Probably nothing.
Thanks for the explanation.
Protomaps sounds interesting.
Pretty cool option and easy to reuse.
agree with this totally, use it on a project I am working on and it now takes like 3-4 hour to have a self hosted map of the world on your computer.
okay, but what clients work with this approach?
You can use the pmtiles:// protocol in Maplibre GL, requires protomaps.js and a few lines of setup [1]
My experience with it is ... ok. It works. But going directly to cloud storage (s3 in my case) is unpredictable latency and neither the browser nor most servers really cache HTTP range requests granularly, so every tile is another high-latency round trip. Not worth it - I ended up putting Martin tile server in front of it.
I assume someone could write a protomaps adapter in WASM with some smart caching? Until then, Standard GET requests are just easier to cache and perform much better in practice. The downside being you have to run a server or statically generate files.
[1]- https://docs.protomaps.com/pmtiles/maplibre
I've had success with using a cache in front of my buckets for great performance. In my case I have raster tiles so they get turned into z/x/y tile filenames and a cloudflare worker pulls that from the full file and caches the result in the region.
For what it's worth I think latency/reliability varies a lot with provider. Bunny Storage has quite good latency in my experience (100-300ms) and their CDN supports Range caching (from my understanding Cloudflare does too they just limit the size of the file regardless of the Range)
we use pmtiles on s3 behind cloudfront, and it seems to work pretty well. maybe not a 100% solution compared to what you'd get from google maps, but good enough that i've got no reason to be looking for another solution.
Protomaps, pmtiles, are actually pretty ubiquitous. Even has a GDAL driver https://gdal.org/en/stable/drivers/vector/pmtiles.html
There is an npm library that integrates the format into MapLibre (fork of Mapbox) and Leaflet.
A quick search showed that this should work with HTTP range requests: https://maplibre.org/
Really cool, did not know about it!
Super nice!
I use this on my blog with MapLibreGL. I wrote up how I do it: https://blog.gpkb.org/posts/hugo-static-site-maps/
One thing I really like is that the data is static. This isn't useful for some applications, but for my use, namely blogging about my travels, it's perfect. I wouldn't come back and edit the text or pictures to reflect subsequent events, so why would I edit the map? Being able to take ad hoc snapshots of the map at a point in time is perfect.
Another open-for-everyone tile server is Tuiles en Libertés : https://tuiles.enliberte.fr/
Same experience on the routing side. I self-host Valhalla on a cheap VPS for a road-trip planner instead of paying per request for a routing API. The setup takes an afternoon of building tiles and figuring out the config, but after that the cost is flat, and that's what makes a free tier possible at all. Paying per request for routing would have killed the free plan.
For a browser viewer on a different origin, I’d test the actual 206 response and CORS behavior from the deployed page, not just from curl. If the client needs to inspect `Content-Range` or `ETag`, those response headers may need to be exposed; a repeat range request also shows whether the CDN is serving the expected cached slice.
CoMaps said hi and uses OpenStreet maps.
It works amazingly on GrapheneOS, Android Auto, and Desktop app via Flatpak.