[OSM-dev] 412 Precondition failed and how to recover from it

D Tucny d at tucny.com
Thu Jul 26 03:34:22 BST 2007


On 26/07/07, Dermot McNally <dermotm at gmail.com> wrote:
>
> On 25/07/07, D Tucny <d at tucny.com> wrote:
>
> > What console output are you getting from JOSM? It should show which
> object
> > it was trying to upload when it got the error which should help you
> track it
> > down...
>
> Here's what I got:
>
> upload to: http://www.openstreetmap.org/api/0.4/segment/create
> got return: 412 with id 0
> <?xml version='1.0' encoding='UTF-8'?>
> <osm version='0.4' generator='JOSM'>
>   <segment id='0' visible='true' from='32721926' to='32722017'>
>     <tag k='created_by' v='JOSM' />
>   </segment>
> </osm>
>
> I'm not that clued in on the data representation, but I assume that
> the return is identifying a segment of ID 0 (doesn't zero represent
> brokenness?) between the two named nodes as being the difficulty? Any
> way of having JOSM search for those nodes by number? I can't spot such
> a feature...


well, segment ID of 0 in this case is fine, you're making a new segment and
the API will give you the segment ID when it's been added, or not as it's
failed... Checking the history for those nodes gives this...

GET http://api.openstreetmap.org/api/0.4/node/32721926/history

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.4" generator="OpenStreetMap server">
  <node id="32721926" lat="52.140773" lon="-8.275918" user="mackerski"
visible="true" timestamp="2007-07-25T00:07:52+01:00">
    <tag k="created_by" v="JOSM"/>
  </node>
  <node id="32721926" lat="52.140773" lon="-8.275918" user="mackerski"
visible="false" timestamp="2007-07-25T00:17:59+01:00">
    <tag k="created_by" v="JOSM"/>
  </node>
</osm>

GET http://api.openstreetmap.org/api/0.4/node/32722017/history
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.4" generator="OpenStreetMap server">
  <node id="32722017" lat="52.1406209644915" lon="-8.275863278262"
user="mackerski" visible="true" timestamp="2007-07-25T00:08:01+01:00">
    <tag k="created_by" v="JOSM"/>
  </node>
  <node id="32722017" lat="52.1406209644915" lon="-8.275863278262"
user="mackerski" visible="false" timestamp="2007-07-25T00:18:13+01:00">
    <tag k="created_by" v="JOSM"/>
  </node>
</osm>

So yep, the nodes have been deleted... (visible="false")

To find those, using the JOSM search function, you can use the useful, but
not overly obvious id:<id> search string, e.g. id:32722017 and you should
find the node...

Good luck :)

d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070726/500f3d64/attachment.html>


More information about the dev mailing list