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

Adding data to (runnning) postgresql with osm2pgsql

0

Hello,

after following this https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ tutorial I wonder, if it is possible to add additional files to a postgresql, even if it is running.

 osm2pgsql -d gis --create --slim  -G --hstore --tag-transform-script ~/src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 1 -S ~/src/openstreetmap-carto/openstreetmap-carto.style ~/data/azerbaijan-latest.osm.pbf

Will executing this command again, only with a different osm.pbf, result in an error or will it merge the new data into the existing one? What if I add data which the existing data is a subset of (Germany already imported and I execute osm2pgsql with the Europe osm.pbf)? Will it overwrite the existing data?

asked 24 Jan '19, 14:49

Erik1988osm's gravatar image

Erik1988osm
21225
accept rate: 0%


One Answer:

0

This is a more that frequent FAQ.

  • In general datasets need to be merged before import, if they are very far apart they might not have common objects, but as soon as they have you will run in to constraint violations.
  • the --create flag will remove any existing data, so you definitely don't want to use that on trying a second import.

answered 24 Jan '19, 19:07

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Source code available on GitHub .