Live data from Hacker News

Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

github.com

51–60 of 84 posts

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#51
post #4

explanation of what this is would be nice

OpenStreetMap is a map ecosystem based on an open data set. There are numerous redundant ways of achieving the same thing with this data, whether it's hosting the "tiles" (the thing you see on the map), search, UI, location bookmarking, navigation, etc. This is great for flexibility, but it's a difficult thing to dive into and understand.

With that said, the "tile hosting" part is notoriously difficult to actually self-host. It's a lot of data, it traditionally took a lot of time to transform the raw data into the png files representing the tiles. Many if not most web apps actually call out to openstreetmap.org or similar to do the tiles for them. That's not fully self-hosting. But more recently, there have been new ways to do tiles, namely with vector formats instead of pngs. They take up less space, they're easier to share around.

So this submission appears to be a simple few lines to get your fully self-hosted tile server of the whole planet up and running. You should then be able to use this in whatever web app you're making to make it fully self hosted (though if you wanted self-hosted search, that's another hard one...).

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#52
post #43

Earlier quoted context omitted.

90 is okay, when I did years ago I was on 300+ but it doesn't really state which zoom level is available.

It seems to be 0-14 according to the GitHub repo.

Yeah going to full 20 requires about 2TB iirc, OSM doesn't host beyond level 19 anymore either to reduce traffic. 14 is around 10m per pixel, best you'll be able to make out on that is like a street. Not useful enough to bother with imho, even 19 leaves a lot to be desired up close.

https://wiki.openstreetmap.org/wiki/Zoom_levels

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#53
post #37

Earlier quoted context omitted.

Hosting maps of the entire planet in a single file doesn't seem practical. How do you keep it updated? PMTiles is good for small local maps, but I don't think they're meant for this scale.

I assumed you would keep it updated the same way you do with mbtiles, but I see that mbtiles are an sqlite so I guess you can do atomic updates with mbtiles. Note though that there are many cases on which served tile information rarely changes. A lot of us are serving a once-downloaded mbtile file and are using this just to _not_ use a provider (mapbox, ...)

> Note though that there are many cases on which served tile information rarely changes.

It depends on what you're doing, but outdated maps can be worse than no maps. On low zoom values that probably works fine, but new buildings and streets are built everyday all over the world.

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#54
post #43

Earlier quoted context omitted.

It seems to be 0-14 according to the GitHub repo.

Yeah going to full 20 requires about 2TB iirc, OSM doesn't host beyond level 19 anymore either to reduce traffic. 14 is around 10m per pixel, best you'll be able to make out on that is like a street. Not useful enough to bother with imho, even 19 leaves a lot to be desired up close. https://wiki.openstreetmap.org/wiki/Zoom_levels

Worth noting that these are vector tiles and not raster tiles, so zoom levels work slightly differently. Generally you don't need as high zoom level with vector tiles since it is much easier to 'zoom in' on vector data than on raster data. A vector zoom level of 14 stores the data with roughly 50cm precision which is good enough for most casual mapping uses.

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#55
post #46

Earlier quoted context omitted.

> incredibly vague and unhelpful As is very common with projects on Github. They should have a paragraph at the start explaining simply what they do.

They 'could' have a paragraph at the beginning to help potential users understand the purpose of the project. It might seem inconsequential, but maintainers often deal with a lot of angry entitled users and it could be helpful to stay away from language that implies that the people giving away their code for free (and for fun) have any obligation to provide anyone anything.

True on principle, but if an explanation or a screenshot that costs 5 hours to make would prevent replying or even just reading support requests for 6 hours, I would call it a victory.

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#56
post #42

Does anyone know if there is a way to host just a few of the tiles in a static way? For example, if I wanted to build a web page which just shows a map at zoom level 6 for a lat/lng point, and then go to zoom level 13. That would require a tiny subset of tiles; is there a simple way to add the tiles plus the JS code in a static way so no external downloads were necessary?

Look at https://protomaps.com/ - You can have a single file in a that represents the vector data for a region at multiple zoom levels. There used to be a really nice UI where you could just select a region. They've changed things around a bit since then so I'm not sure how it works now.

The replacement for the UI is to use the "pmtiles extract" command line tool:

https://docs.protomaps.com/guide/getting-started#_3-extract-...

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#57
post #29

While useful, this still uses a server to process tile requests. Why not https://github.com/protomaps/PMTiles ? For the record, I am currently using maptiler over at https://citybik.es to serve tiles, and I am evaluating moving to serving static pmtiles on range requests to cut the middle man

PMTiles is great, but there's a risk hosting multi-gb files on metered hosting -- a client might not respect range requests and you open yourself up to a denial of wallet attack. I can't really see doing it on S3, unless it's behind a lightweight tile server. I'd do it on hetzner or linode or one of the lower cost bandwidth providers. (edit -- citybik.es is pretty cool, are you backing up to GBFS or a different set o…

To mitigate the "denial of wallet" attack on S3 there are a few options:

AWS Lambda: https://docs.protomaps.com/deploy/aws lightweight tile server: https://docs.protomaps.com/pmtiles/cli#serve

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#58
post #11

OSM is OpenStreetMaps. This appears to be a server to locally mirror the ~90GB global tile set and serve them with your choice of style to OSM client applications.

It's not OpenStreetMaps, it's OpenStreetMap.

I've always wondered why people keep adding the s. Is it marketing because Google Map sounds like a spelling mistake (missing 's after Google) and we're noticing the effect of that other brand, or is there something about OpenStreetMap that makes it seem like a plural project? People don't say Linuxes, Signals, or Androids

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#59
post #58

Earlier quoted context omitted.

It's not OpenStreetMaps, it's OpenStreetMap.

I've always wondered why people keep adding the s. Is it marketing because Google Map sounds like a spelling mistake (missing 's after Google) and we're noticing the effect of that other brand, or is there something about OpenStreetMap that makes it seem like a plural project? People don't say Linuxes, Signals, or Androids

Maybe because "Google Map" is actually called "Google Maps" (with the s)?

Re: Show HN: Simple Mbtiles Server – Self-host the entire planet of OpenStreetMaps

#60
post #58

Earlier quoted context omitted.

It's not OpenStreetMaps, it's OpenStreetMap.

I've always wondered why people keep adding the s. Is it marketing because Google Map sounds like a spelling mistake (missing 's after Google) and we're noticing the effect of that other brand, or is there something about OpenStreetMap that makes it seem like a plural project? People don't say Linuxes, Signals, or Androids

I think it's most likely that most of the other commonly used alternatives (most significantly Google Maps but also Apple Maps, Bing Maps, Maps.me) use the plural.
Post reply on HN