I am slowly going insane trying to successfully complete an OSM data import and I would like to find an alternative approach. What I'm attempting is frustratingly simple yet fails repeatedly.
Originally I attempted to import the latest planet .osm.bz2 file in slim mode but this failed with a parsing error. Then I tried to import the .pbf in slim mode and this was moving so slowly that it would have taken three months. Then I got the memory in my VM increased to 48GB and removed the -s
slim mode argument, and the import failed when it ran out of memory. Finally I attempted to import the pbf in slim mode with a 44GB node cache and approximately half way through the nodes, after working for several days, it failed with Zlib compression failed (code -3, incorrect data check)
.
There has to be a simpler, faster, and more reliable way to do this. Ideally I would like to simply download someone else's Postgres data file, attach it to my database, sit back and relax.
I need the data to be in the osm2pgsql schema but I really don't care how it gets there, as long as it's no more than a couple of months old. Does anyone know why this is so complicated, and how to make it simpler?
--cache
option when running osm2pgsql. That should help avoid running out of memory. Given that you have 48 GB RAM, I would try--cache 35000
as a starting point. If you can use a smaller extract of the OSM dataset that could help too.