Changeset 2764 in josm for trunk/src/org
- Timestamp:
- 2010-01-07T22:21:37+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r2711 r2764 331 331 int i = 0; 332 332 333 for (RelationMember rm : r.getMembers()) { 333 List<RelationMember> relationMembers = r.getMembers(); 334 for (RelationMember rm: relationMembers) { 334 335 if (rm.isWay() && rm.getMember() == way) { 335 336 boolean insert = true; … … 379 380 insert = false; 380 381 } 381 } 382 else 382 } else { 383 383 insert = false; 384 } 385 else if(!"via".equals(role)) 384 } 385 } 386 else if(!"via".equals(role)) { 386 387 warnme = true; 388 } 387 389 } 388 390 else if (!("route".equals(type)) && !("multipolygon".equals(type))) { … … 395 397 if(insert) 396 398 { 399 if (rm.hasRole() && !("multipolygon".equals(type))) { 400 warnmerole = true; 401 } 402 403 Boolean backwards = null; 404 int k = 1; 405 while (i - k >= 0 || i + k < relationMembers.size()) { 406 if ((i - k >= 0) && relationMembers.get(i - k).isWay()){ 407 Way w = relationMembers.get(i - k).getWay(); 408 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 409 backwards = false; 410 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 411 backwards = true; 412 } 413 break; 414 } 415 if ((i + k < relationMembers.size()) && relationMembers.get(i + k).isWay()){ 416 Way w = relationMembers.get(i + k).getWay(); 417 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 418 backwards = true; 419 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 420 backwards = false; 421 } 422 break; 423 } 424 } 425 397 426 int j = i; 398 boolean backwards = "backward".equals(rm.getRole());399 427 for (Way wayToAdd : newWays) { 400 428 RelationMember em = new RelationMember(rm.getRole(), wayToAdd); 401 if (em.hasRole() && !("multipolygon".equals(type))) {402 warnmerole = true;403 }404 405 429 j++; 406 if ( backwards) {430 if ((backwards != null) && backwards) { 407 431 c.addMember(i, em); 408 432 } else {
Note:
See TracChangeset
for help on using the changeset viewer.