Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create a new master relation for new relations #3208

Closed
KenAlin opened this issue Jun 30, 2016 · 6 comments · Fixed by #3871
Closed

Can't create a new master relation for new relations #3208

KenAlin opened this issue Jun 30, 2016 · 6 comments · Fixed by #3871
Labels
bug A bug - let's fix this!

Comments

@KenAlin
Copy link

KenAlin commented Jun 30, 2016

Hi,

I wanted to add a bus route is OpenStreetMap today using iD, but I got the following error message :

Placeholder Relation not found for reference -3 in relation -2. (Server returned error code 400.)

Here is what I tried to do :

  • Create a relation for a direction (A -> B)
  • Create an other relation for the other direction (B -> A)
  • Create a relation (route master) containing the two previous relations
  • Mapping
  • Sending to the server ... uh oh ...

Here is what I've done :

  • Delete route master
  • Sending to the server ... it worked !
  • Finally, re-creating the route master in a new changeset (it worked too)

I don't really know what happened, nor why it worked when deleting the route master ... Hope this helped.

@bhousel
Copy link
Member

bhousel commented Jun 30, 2016

Thanks! It does sound like a bug..

@bhousel bhousel added the bug A bug - let's fix this! label Jun 30, 2016
@mstn
Copy link
Contributor

mstn commented Feb 23, 2017

Hi, in order to reproduce this bug

curl -u [USERNAME]:[PASSWORD]  -X POST -d @payload.xml http://localhost:3000/api/0.6/changeset/[CHANGESET_ID]/upload

where payload.xml is

<?xml version="1.0" encoding="UTF-8"?>
<osmChange version="0.6" generator="iD">
   <create>
      <node id="-5" lon="11.625506992810122" lat="46.866699181636555" version="0" changeset="3">
         <tag k="highway" v="bus_stop" />
      </node>
      <node id="-6" lon="11.62686047585252" lat="46.86730122861715" version="0" changeset="3">
         <tag k="highway" v="bus_stop" />
      </node>
      <relation id="-2" version="0" changeset="3">
         <member type="node" role="" ref="-5" />
         <tag k="type" v="route" />
         <tag k="name" v="AtoB" />
      </relation>
      <relation id="-3" version="0" changeset="3">
         <member type="relation" role="" ref="-2" />
         <member type="relation" role="" ref="-4" />
         <tag k="type" v="route_master" />
         <tag k="name" v="master" />
      </relation>
      <relation id="-4" version="0" changeset="3">
         <member type="node" role="" ref="-6" />
         <tag k="type" v="route" />
         <tag k="name" v="BtoA" />
      </relation>
   </create>
   <modify />
   <delete if-unused="true" />
</osmChange>

The output is

Placeholder Relation not found for reference -4 in relation -3.

The problem is that the master relation (-3) that contains the two children (-2 and -4) should be listed at the end of the create tag. If you edit payload.xml by hand, it works.

@pnorman
Copy link
Contributor

pnorman commented Feb 23, 2017

if that payload.xml is generated by iD, then it's in error. And has way too many significant figures on the nodes.

@mstn
Copy link
Contributor

mstn commented Feb 23, 2017

Yes, it is generated by iD (just copied and pasted from network tab).

@bhousel
Copy link
Member

bhousel commented Feb 26, 2017

per openstreetmap/openstreetmap-website#1465 (comment)
let's:

  • reorder the relations in the changeset so that children appear in the file before their parents
  • add some checks throughout iD to prevent users from creating circular relation graphs

@pnorman
Copy link
Contributor

pnorman commented Feb 26, 2017

If you take the sequence of actions taken by a user and turn it into a diff it should always work, but it will be too verbose (e.g. create node, modify node to add tag, modify node to change location instead of one create node with tag at second location).

So it should be possible to do this by changing the formation of the osmChange rather than re-ordering, but I don't know which is easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants