Opened 5 years ago
Closed 5 years ago
#637 closed defect (fixed)
[PATCH] JOSM allows duplicate members in relations
| Reported by: | rvollmert@… | Owned by: | anonymous |
|---|---|---|---|
| Priority: | major | 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 Changed 5 years ago by rvollmert@…
comment:2 Changed 5 years ago by framm
- Owner changed from framm to anonymous
- Status changed from new to 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 Changed 5 years ago by smsm1
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 Changed 5 years ago by smsm1
JOSM doesn't recognise a 412 precondition failed when a relation is uploaded.
comment:5 Changed 5 years ago by schusch
see #782 for this bug too
comment:6 Changed 5 years ago by Dirk Stöcker <openstreetmap@…>
- Summary changed from JOSM allows duplicate members in relations to [PATCH] JOSM allows duplicate members in relations
Patching the problem by no longer adding elements multiple times.
comment:7 Changed 5 years ago by framm
- Resolution set to fixed
- Status changed from assigned to closed
Patch applied for r669.



I've since found out that error 500 is a bug in the API, so maybe JOSM isn't at fault?