4 ms·
I apologize if this is something stupid, or answered elsewhere, but is there a good way to trim Planet down to a smaller area? I've been making some custom map
by c0nsumer 2y ago
I apologize if this is something stupid, or answered elsewhere, but is there a good way to trim Planet down to a smaller area?
I've been making some custom map stuff for mountain bike trails and I'd really like to move to self-hosted vector tiles for all layers, but too much of what I find says to start with Planet.osm when all I really need is a State (in the US) or even a few-miles-wide area.
(My goal is to basically snapshot OSM data, generate tiles, and use that until I decide to do another snapshot down the line, so the underlying data doesn't change. And limit it to a small area because that's all I need.)
Examples of maps I've done this way, and want to improve, are: https://trailmaps.app/ramba/ https://trailmaps.app/ramba/ and https://trailmaps.app/dte/ https://trailmaps.app/dte/
- hyperknot 2y agoIf you know the tile numbers, you can just copy them out of the Btrfs image.
- puddingvlaai 2y agoLook into Planetiler [1] (which OP uses for tile generation). It supports downloading regions that are listed on Geofabrik [2] and converting them to mbtiles or pmtiles. Geofabrik has separate extracts for all US states, for example. If you need to extract an even smaller area from that result, GDAL has support for mbtiles so you could use gdalwarp [3] to extract a new mbtiles file out of it using bounds. Another option is to use the extract functionality in pmtiles [4] to extract your area of interest from their daily full-planet pmtiles builds. You can then statically host that file and use that in your client with one of their client libraries. [1] https://github.com/onthegomap/planetiler https://github.com/onthegomap/planetiler [2] https://download.geofabrik.de/ https://download.geofabrik.de/ [3] https://gdal.org/en/latest/programs/gdalwarp.html https://gdal.org/en/latest/programs/gdalwarp.html [4] https://docs.protomaps.com/pmtiles/cli#extract https://docs.protomaps.com/pmtiles/cli#extract