I've written a PHP script that updates some tages of a previously retrieved node information. Before updating the node, I request a changeset and the current content of the node. I than make the required changes to the node's tags. So far so good. When I try to upload the changes, I get the message: "Version mismatch: Provided 7, server had: 8 of Node 1479973945" I don't understand why this happened because the version number is in the node's XML which I request just before making the changes. I have also tried incrementing teh version number by 1 but that gave the same error. Does someone know what the problem might be? Chris asked 25 Oct '11, 09:02 Chris Peters |
I do not know what you mean by "requesting a changeset" but obviously you have changed this node 8 times in a row. Each time you upload a changeset with a "modify" section concerning that node, the node's version ID is incremented, and if you want to make another change to the node, you need to use the new version number. Simply opening a changeset does not increment anything of course, but that isn't required for retrieving data anyway - so what you should do is
You should never increase the version number manually as this might lead to accidental overwriting of someone else's changes. And, another thing: If you want to test your editing software, please do that on api.dev.openstreetmap.org and not on the main site. Your experiments are visible to all, forever, and take up space in our database. answered 25 Oct '11, 09:20 Frederik Ramm ♦ |
I think, requesting a changeset already increases the version number. Look at the nodes history: http://www.openstreetmap.org/browse/node/1479973945/history Try to get the nodes tags without requesting the changeset, make the changes locally and upload them. Have you added action="modify" before uploading? answered 25 Oct '11, 09:15 ajoessen |