This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

osm2pgsql with –flat-nodes question (closed)

0

when import the pbf file with : osm2pgsql --create --slim --flat-nodes /mnt/resource/nodes.cache /opt/osm/planet-190805.osm.pbf

then, the file /mnt/resource/nodes.cache must been keep for osm2pgsql --append ?

and will the osm2pgsql --append update the file /mnt/resource/nodes.cache for next running time?

and is the file /mnt/resource/nodes.cache need for mapnik etc.?

asked 30 Aug '19, 02:35

Nationals's gravatar image

Nationals
11446
accept rate: 0%

edited 03 Sep '19, 01:22

how about the performance different using --flat-nodes or not while osm2pgsql --create?

(30 Aug '19, 03:13) Nationals

One Answer:

2

If you want to do updates with --append then you need to keep the flatnodes file, and specify it again with --flat-nodes when doing the update. If you do not want to do updates then you can delete the file.

The performance on the initial import is better with --flat-nodes if you have a large data set; for very small data sets (small country, or just a state or so) it can be faster without.

answered 30 Aug '19, 09:01

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

thanks for your reply.

and is the file /mnt/resource/nodes.cache need for mapnik etc. ?

(30 Aug '19, 09:11) Nationals

No, it is only accessed by osm2pgsql.

(30 Aug '19, 09:41) Frederik Ramm ♦

Source code available on GitHub .