- Timestamp:
- 2020-03-24T07:37:08+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java
r15943 r16200 501 501 direction = Direction.IRRELEVANT; 502 502 } else { 503 boolean previousWayMemberMissing = true; 504 boolean nextWayMemberMissing = true; 505 503 506 // For ordered relations, looking beyond the nearest neighbour members is not required, 504 507 // and can even cause the wrong direction to be guessed (with closed loops). 505 508 if (ir - 1 >= 0 && relationMembers.get(ir - 1).isWay()) { 506 509 Way w = relationMembers.get(ir - 1).getWay(); 507 if (w.lastNode() == way.firstNode() || w.firstNode() == way.firstNode()) { 508 direction = Direction.FORWARDS; 509 } else if (w.firstNode() == way.lastNode() || w.lastNode() == way.lastNode()) { 510 direction = Direction.BACKWARDS; 510 if (!w.isIncomplete()) { 511 previousWayMemberMissing = false; 512 if (w.lastNode() == way.firstNode() || w.firstNode() == way.firstNode()) { 513 direction = Direction.FORWARDS; 514 } else if (w.firstNode() == way.lastNode() || w.lastNode() == way.lastNode()) { 515 direction = Direction.BACKWARDS; 516 } 511 517 } 518 } else { 519 previousWayMemberMissing = false; 512 520 } 513 521 if (ir + 1 < relationMembers.size() && relationMembers.get(ir + 1).isWay()) { 514 522 Way w = relationMembers.get(ir + 1).getWay(); 515 if (w.lastNode() == way.firstNode() || w.firstNode() == way.firstNode()) { 516 direction = Direction.BACKWARDS; 517 } else if (w.firstNode() == way.lastNode() || w.lastNode() == way.lastNode()) { 518 direction = Direction.FORWARDS; 523 if (!w.isIncomplete()) { 524 nextWayMemberMissing = false; 525 if (w.lastNode() == way.firstNode() || w.firstNode() == way.firstNode()) { 526 direction = Direction.BACKWARDS; 527 } else if (w.firstNode() == way.lastNode() || w.lastNode() == way.lastNode()) { 528 direction = Direction.FORWARDS; 529 } 519 530 } 531 } else { 532 nextWayMemberMissing = false; 533 } 534 535 if (direction == Direction.UNKNOWN 536 && !previousWayMemberMissing 537 && !nextWayMemberMissing) { 538 // If both the next and previous way member in the relation are already known at 539 // this point, and they are not connected to this one, then we can safely 540 // assume that the direction doesn't matter. Downloading any more members 541 // won't help in any case. 542 direction = Direction.IRRELEVANT; 520 543 } 521 544 }
Note:
See TracChangeset
for help on using the changeset viewer.