2

I have added data (e.g. name keys) to my OSM PostgreSql database. How can I update my database without deleting or overwriting this data? In other words, how can I merge newer OSM data to my existing database without losing my additional data?

2
  • I guess this depends on quite how you added your additional data. If you created extra columns or (worse) added more values to the tags column, then it's going to be difficult. Easier if your own data is in separate tables, keyed to the OSM id. Commented Dec 2, 2015 at 14:09
  • I want to use iD editor and the rails port. If I use Osmosis to update my database, are my additional tags (e.g. name_abcd, with key value) deleted or preserved?
    – phlegx
    Commented Dec 2, 2015 at 16:14

1 Answer 1

2

In the OpenStreetMap environment so-called "diff-files" are used to update your PostgreSQL/PostGIS OSM-DB. This can be done based on minutely, hourly or daily diffs. There are several tools to do this, I recommend to use osmosis. This OSM wiki page gives a comprehensive overview.

In the German OSM forum there is quite a good thread on this topic. As already mentioned by @Toby Speight in the comments you should keep your updates seperated from the original OSM data so they wont be messed up.

2
  • Thank you for the reply! If I keep my additional data (tags) separated to another table, then I cannot use iD editor to edit this tags. So, it depends how osmosis import the changes. Are my additional tags (e.g. name_abcd, with key value) deleted or preserved?
    – phlegx
    Commented Dec 3, 2015 at 13:30
  • Diff-files only contain the differences between two OSM database timestamps. Therefore you should keep your additional tags in the seperated column. After importing the diff-file create a new column based on the osm-tag-column and enrich it with your additional tags. This will keep the OSM dataset clean (and you have a back-up of your additional data). Commented Dec 3, 2015 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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