NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%20Peters's gravatar image

Chris Peters
1111
accept rate: 0%


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

  1. retrieve node data
  2. create changeset
  3. update node(s) using the version numbers from step 1
  4. close changeset

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.

permanent link

answered 25 Oct '11, 09:20

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

2

especially the api.dev.openstreetmap.org bit

(25 Oct '11, 17:44) Andy Allan
-2

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?

permanent link

answered 25 Oct '11, 09:15

ajoessen's gravatar image

ajoessen
16826
accept rate: 9%

edited 25 Oct '11, 09:16

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×199
×26
×9

question asked: 25 Oct '11, 09:02

question was seen: 8,919 times

last updated: 25 Oct '11, 17:44

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum