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

rollback osm2pgsql append changes

0

I did create a self hosted map server with Mapnik and postgis. So i did append an OSM file which i created in josm. How i can delete those changes? I used --append switch when using osm2pgsql, Is it replace the old data with new one?

asked 06 Apr '18, 22:56

cybercoder's gravatar image

cybercoder
36668
accept rate: 0%


2 Answers:

2

The answer is probably "with difficulty", unfortunately. If your new file contains changes and deletes then you'll need to find out what the previous versions of those objects were.

If, however your appended file only contained creates, then you can programmatically create a file that deletes those additions.

answered 07 Apr '18, 00:07

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

1

One thing you could do is:

  • create a list of all relations, ways, and nodes mentioned in the file that you created in JOSM.
  • download all these objects from the OSM API (e.g. with something like wget -Omysfile.osm http://api.openstreetmap.org/api/0.6/nodes?nodes=1,2,3,4)
  • using --append mode again, add this data to your database, overwriting any modifications you made with current data from OSM.

This will not "go back" to whatever your data was before your modification, but instead "go forward" to whatever the current state is in OSM, but perhaps it helps?

answered 07 Apr '18, 08:51

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .