0

I would like to use osm2pgsql to load the europe.osm.pbf to the database. I've already read about the optimalization to make the osm2pgsql do it as fast as possible. However, there's one option, that I really don't understand, which is --flat-nodes <flat nodes>.
What is this file? Where is it located?

2

The flat nodes file is just a temporary file generated by the osm2pgsql program during import, so it isn't "located" anywhere. Instead, the --flat-nodes <flat nodes> input parameter, allows you to specify the location and filename where osm2pgsql should create this temporary file. Note that for Geofabrik's Europe extract, the generated flat nodes file is close to 50 GB, so make sure you have the disk space to accommodate this when specifying the location.

The flat nodes file is used to store all the nodes of the PBF file (>4.8 billion for current planet extract) to be imported, instead of storing all this temporary information in PostgreSQL. As it is optimized for this purpose, it is more efficient in terms of storage requirement.

As it needs to access this file a lot, setting the location to some form of fast (NVMe) SSD is probably highly beneficial.

By the way, I have found this excellent summary of all command line options of osm2pgsql highly useful: http://www.volkerschatz.com/net/osm/osm2pgsql-usage.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.