Ticket #9887: PasteRelationsAction-associatedStreet.patch
| File PasteRelationsAction-associatedStreet.patch, 1.4 KB (added by , 12 years ago) |
|---|
-
plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java
55 55 boolean changed = false; 56 56 for( OsmPrimitive p : selection ) { 57 57 if( !r.getMemberPrimitives().contains(p) && !r.equals(p) ) { 58 r.addMember(new RelationMember(relations.get(rel), p)); 58 String role = relations.get(rel); 59 if ("associatedStreet".equals(r.get("type"))) { 60 if (p.get("highway") != null) { 61 role="street"; 62 if ((p.get("name") == null) && (r.get("name") != null)) { 63 commands.add(new ChangePropertyCommand(p, "name", r.get("name"))); 64 } 65 } else if (p.get("addr:housenumber") != null) { 66 role="house"; 67 } 68 } 69 r.addMember(new RelationMember(role, p)); 59 70 changed = true; 60 71 } 61 72 }
