Till now, whatever changes I do in the OSM data, I again download the latest data from OSM or from http://extract.bbbike.org/ and import the fresh data in the database. But this is not the efficient approach.
So Today, I am going to introduce you with the term osmosis. You can read it in detail from here
$sudo apt install osmosis
$osmosis -v //tell version
INFO: Osmosis Version 0.44.1
Now, it’s time to use the tool. The first command I tried to check the difference in the changesets of the two files was
$ osmosis –read-xml file=”ludh.osm” –read-xml file=”ludhiana.pbf” –derive-change –write-xml-change file=”planetdiff-1-2.osc”
Luckily, I encountered with an error.;)
SEVERE: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: An output error has occurred, aborting.
After browsing on the internet then I came to know about my silly mistake. For the file ludhiana.pbf I was using the flag –read-xml instead of –read-pbf. The correct command is
$ osmosis –read-xml file=”ludh.osm” –read-pbf file=”ludhiana.pbf” –derive-change –write-xml-change file=”planetdiff-1-2.osc”
Similarly, we can explore osmosis a lot.