[OSM-dev] OsmChange format and 0.6

Frederik Ramm frederik at remote.org
Mon Feb 9 01:06:06 GMT 2009


    I have come across a strange logic twist and want to confuse you 
with it. (Maybe it was clear to anybody anyway, don't know.)

API 0.6 supports uploading OsmChange files, with the additional 
requirement that each node/way/relation contained in the change file be 
given an extra "changeset" attribute. (Escapes me now why we did not 
have that in the header but I remember there was a valid reason for it.)

Now one should think that if I have two API server and generate a diff 
from server #1 with Osmosis, it should be possible to upload that to 
server #2 through the API (after amending every object with a changeset 

But that doesn't work: API 0.6 of course expects the uploader to report 
the current version of each object they have, to make sure it matches 
the database version before incrementing the version number and storing 
the new data. Whereas Osmosis of course writes the current version 
number to the file.

So, if you wanted to upload an Osmosis-generated .osc to another server, 
not only would you have to add changesets, but you would also have to 
decrement each version number!

Come to think of it, you would also have to replace the IDs of all newly 
created objects in the osc file by negative IDs so that the destination 
server can issue its own IDs... so it seems that, while superficially 
the same, there is a world of difference between an osc file as created 
by Osmosis and one as read by the API. - Maybe we should have opted for 
a wholly different format to make this clearer. Sigh.


Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"

More information about the dev mailing list