Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

peermaps subdivided openstreetmap archive #74

Open
ghost opened this issue Dec 19, 2016 · 1 comment
Open

peermaps subdivided openstreetmap archive #74

ghost opened this issue Dec 19, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 19, 2016

on ipfs: QmXJ8KkgKyjRxTrEDvmZWZMNGq1dk3t97AVhF1Xeov3kB4

on dat: 04ed0b08ff595a992a594ad1ab624072646467ec7eda2dc40e4aa512e49cb196

Using this shell script I've divided planet-latest.osm.pbf into 215836 .o5m.gz files (which osmconvert can read) and 14389 meta.json files.

Each .o5m.gz file is less than or equal to 1M, so running a tile cutter shouldn't require a lot of RAM, just time and disk space.

The branch factor of this subdivision is 16. The extents of each branch from 0 through 15, inclusive, is encoded in the meta.json file located in every directory. The values are [west,south,east,north] (wsen). Each key maps to a file $key.o5m.gz or a directory $key/ with its own files 0 through 15, inclusive, and a meta.json. Here's an example of what meta.json looks like:

{"0":[-22.5,38.68218745348944,-16.875,41.01449966573052],
"1":[-22.5,41.01449966573052,-16.875,43.432536557789774],
"2":[-22.5,43.432536557789774,-16.875,45.95137432591568],
"3":[-22.5,45.95137432591568,-16.875,48.590377890729144],
"4":[-16.875,38.68218745348944,-11.25,41.01449966573052],
"5":[-16.875,41.01449966573052,-11.25,43.432536557789774],
"6":[-16.875,43.432536557789774,-11.25,45.95137432591568],
"7":[-16.875,45.95137432591568,-11.25,48.590377890729144],
"8":[-11.25,38.68218745348944,-5.625,41.01449966573052],
"9":[-11.25,41.01449966573052,-5.625,43.432536557789774],
"10":[-11.25,43.432536557789774,-5.625,45.95137432591568],
"11":[-11.25,45.95137432591568,-5.625,48.590377890729144],
"12":[-5.625,38.68218745348944,0,41.01449966573052],
"13":[-5.625,41.01449966573052,0,43.432536557789774],
"14":[-5.625,43.432536557789774,0,45.95137432591568],
"15":[-5.625,45.95137432591568,0,48.590377890729144]}

Another nice thing about this data structure is that you can perform ad-hoc extracts for any extents by walking the meta.json files recursively to build up a list of files you can stream into osmconvert.

Previously:

@ghost
Copy link

ghost commented Nov 29, 2017

I replicated this pin to one more storage host

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants