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

export osm2pgsql to osm

0

Hello i use osm2pgsql to import data into the tile server database,such as "osm2pgsql --slim -d gis -C 1600 --number-processes 3 mymap.osm.pbf. Now i want export data to osm or bpf file.

Any ideas?

Thanks a lot!

asked 22 Jul '17, 17:28

bz3616's gravatar image

bz3616
1223
accept rate: 0%


One Answer:

1

The osm2pgsql schema is not really suitable for a re-export to OSM format (xml or pbf) as depending on how you set things up (essentially you would have had to thought about this before the import and if you had, you wouldn't have used osm2pgsql) you will have lost the necessary information to recreate all objects as they where before the import.

In any case you WILL need to roll your own exporter for this (if you can actually live with the information loss).

answered 22 Jul '17, 19:19

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 22 Jul '17, 20:01

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273

Source code available on GitHub .