Remix.run Logo
▲ Protomaps: Self-hosting map tiles has gotten cheap and easy(bruceroettgers.eu)
33 points by bcye 3 hours ago | 11 comments
▲neomantra 2 minutes ago | parent | next [-]

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

▲doodlebugging 15 minutes ago | parent | prev | next [-]

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?

▲bcye 11 minutes ago | parent [-]

It's my API endpoint for Plausible (private website analytics), not sure why it would get flagged

▲doodlebugging a minute ago | parent [-]

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.

▲pluto_modadic an hour ago | parent | prev [-]

okay, but what clients work with this approach?

▲perrygeo 38 minutes ago | parent | next [-]

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

▲wkrp 2 minutes ago | parent | next [-]

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.

▲bcye 28 minutes ago | parent | prev [-]

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)

▲cr125rider 37 minutes ago | parent | prev | next [-]

Protomaps, pmtiles, are actually pretty ubiquitous. Even has a GDAL driver https://gdal.org/en/stable/drivers/vector/pmtiles.html

▲bcye 42 minutes ago | parent | prev | next [-]

There is an npm library that integrates the format into MapLibre (fork of Mapbox) and Leaflet.

▲pstuart 37 minutes ago | parent | prev [-]

A quick search showed that this should work with HTTP range requests: https://maplibre.org/