[OSM-dev] correcting relation after 412 error

ivom ivo.vdmaagdenberg at pandora.be
Tue Sep 2 23:34:47 BST 2008


Thanks many times for pinpointing the problem!

The recent build of josm is actually pretty descriptive about which 
nodes/ways/relations have a problem during
uploads. You have to make sure you can see this output tough... Maybe not 
only add the errors on the commandline,
but make sure the end-user is aware of the fact that something went wrong.

The output made me not have to sift through the relation like you 
suggested, with the binary search and all that.

Downloading the faulty way in a separate osm file and opening it in josm 
as a separate layer made it pretty easy to
zoom in to the problem. Fixed that :)

However from your suggestion I understand that you make a new relation to 
research the problem, but do you also mean
to fill the relation with all the members minus the faulty ways and/or 
nodes?

To try and answer this myself I opened the faulty relation in josm, 
selected all it's members, clicked on the
'select'-button. Then I created a new relation, added all that is selected 
and removed the faulty way. Then upload
and...
"
upload to: 
http://www.openstreetmap.org/api/0.5/relation/create...connected
got return: 200 with id 30763
"
I can use this new relation to revamp the original relation from here on.

Deleting the original relation and after that the faulty way went ok.

Ivom

On Sat, 30 Aug 2008, Frederik Ramm wrote:

> Hi,
>
>> I am trying to find out the reason why uploading modifications to relation 
>> (id=5286) through josm consistently results in the following error:
>
> Steven has already mentioned one of the problems for you, but as you rightly 
> say there is another problem. I'll give you (and others) a quick run-down of 
> what I tend to do in these cases.
>
> 1. Download the relation into a file.
> 2. Download every way referenced, and check whether all ways actually exist. 
> (They do in this case.)
> 3. Download all nodes referenced by all these ways and check whether they 
> actually exist. (They do in this case, but I had situations where one of the 
> ways that make up the relation were broken because one of their nodes had 
> been deleted and you'll see 412 on relation upload in these cases.)
> 4. If all this doesn't help, then create a new relation and find the culprit 
> through binary search, i.e. first upload the relation with all its members. 
> On 412, comment out (using <!-- and -->) the first half of members in the 
> relation XML, re-upload. If this works, then the problem is in the first 
> half; now comment out only the first quarter, and so on, until you have found 
> the one member where upload works if it is commented out, and upload doesn't 
> work if you have it in.
>
> In this case, the offending way seems to be way #22949135. Remove it from the 
> relation and it will upload. Why? That way looks perfectly normal...
>
> <?xml version="1.0" encoding="UTF-8"?>
> <osm version="0.5" generator="OpenStreetMap server">
>  <way id="22949135" visible="true" timestamp="2008-08-05T15:14:49+01:00" 
> user="Djohnnie">
>    <nd ref="247267461"/>
>    <nd ref="247267463"/>
>    <tag k="highway" v="residential"/>
>    <tag k="created_by" v="Potlatch 0.10b"/>
>    <tag k="name" v="Elisabethplein"/>
>  </way>
> </osm>
>
> ... UNTIL you look at its history:
>
> <osm version="0.5" generator="OpenStreetMap server">
>  <way id="22949135" visible="true" timestamp="2008-02-11T20:53:59+00:00" 
> user="ivom">
>    <nd ref="247267461"/>
>    <nd ref="247267462"/>
>    <nd ref="247267463"/>
>    <tag k="created_by" v="JOSM"/>
>    <tag k="highway" v="residential"/>
>  </way>
>  <way id="22949135" visible="true" timestamp="2008-05-04T20:42:39+01:00" 
> user="ivom">
>    <nd ref="247267461"/>
>    <nd ref="247267462"/>
>    <nd ref="247267463"/>
>    <tag k="name" v="Elisabethplein"/>
>    <tag k="created_by" v="JOSM"/>
>    <tag k="highway" v="residential"/>
>  </way>
>  <way id="22949135" visible="true" timestamp="2008-05-05T21:40:24+01:00" 
> user="ivom">
>    <nd ref="247267461"/>
>    <nd ref="247267462"/>
>    <nd ref="262395126"/>
>    <nd ref="247267463"/>
>    <tag k="name" v="Elisabethplein"/>
>    <tag k="created_by" v="JOSM"/>
>    <tag k="highway" v="residential"/>
>  </way>
>  <way id="22949135" visible="true" timestamp="2008-08-05T15:14:49+01:00" 
> user="Djohnnie">
>    <nd ref="283641193"/>
>    <nd ref="247267461"/>
>    <nd ref="247267462"/>
>    <nd ref="28364119"/>
>    <nd ref="262395126"/>
>    <nd ref="247267463"/>
>    <tag k="name" v="Elisabethplein"/>
>    <tag k="created_by" v="Potlatch 0.10b"/>
>    <tag k="highway" v="residential"/>
>  </way>
> </osm>
>
> This is one of those unfortunate ways where the current version from history 
> is not identical to the real "current" version. This would not happen in a 
> transactional database environment but we don't yet have such, so 
> discrepancies are possible.
>
> Some of the nodes referenced by the latest history version of this way have 
> been deleted, and the "current" table has been updated to reflect this, but 
> the history table still links to non-existent nodes.
>
> And that's why you cannot upload your relation. Fix the way - actually if you 
> just re-upload it in its current state this will fix it - or remove it from 
> the relation.
>
> Bye
> Frederik
>
>




More information about the dev mailing list