Opened 17 years ago
Closed 17 years ago
#637 closed defect (fixed)
[PATCH] JOSM allows duplicate members in relations
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | |
Keywords: | relations | Cc: |
Description
You can add a given way twice to a relation in JOSM with the same role with no problem, but the API doesn't accept this (500). This happened to me with a route relation (role="").
The best solution would probably be to silently discard duplicate entries (so you don't have to worry to select only ways that are not in the relation yet).
The problem is compounded by the fact that visual feedback when adding members to a relation is slim , and that the error on failed upload is misleading, stating a timeout. I will file a separate tickets for these.
Attachments (1)
Change History (8)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
No, JOSM should really not allow the same member twice. However this should probably be checked when you click Ok and not when you "add selected", as you might want to add something twice and THEN adjust the roles to make the situation legal.
comment:3 by , 17 years ago
Due to
add_index "relation_members", ["member_type", "member_id"], :name => "relation_members_member_idx"
in the schema, that won't make it legal.
You can only have a node, way or relation once in each relation.
http://trac.openstreetmap.org/ticket/718 is the ticket for getting the api to return precondition_failed instead of a sever error.
comment:4 by , 17 years ago
JOSM doesn't recognise a 412 precondition failed when a relation is uploaded.
comment:6 by , 17 years ago
Summary: | JOSM allows duplicate members in relations → [PATCH] JOSM allows duplicate members in relations |
---|
Patching the problem by no longer adding elements multiple times.
I've since found out that error 500 is a bug in the API, so maybe JOSM isn't at fault?