Changeset 16302 in josm


Ignore:
Timestamp:
2020-04-15T07:58:00+02:00 (4 years ago)
Author:
GerdP
Message:

see #18863:split ways: false positive warnings about missing members
Correct and simplify additional check introduced with r16242 : order of "!" and "(" was wrong
There is no need to look at other members when the parents of the end nodes of the split-way are known.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java

    r16242 r16302  
    542542                                    direction = Direction.IRRELEVANT;
    543543                                }
    544                                 if (direction == Direction.UNKNOWN && (!way.firstNode().isOutsideDownloadArea()
    545                                         || way.lastNode().isOutsideDownloadArea())) {
    546                                     // check if any other complete way in the relation is connected to the way
    547                                     // if so, the order of the relation is broken
    548                                     for (int i = 0; i < r.getMembersCount(); i++) {
    549                                         if (i >= ir - 1 && i <= ir + 1)
    550                                             continue;
    551                                         RelationMember rmTest = r.getMember(i);
    552                                         if (rmTest.isWay() && !rmTest.getMember().isIncomplete() &&
    553                                             (way.isFirstLastNode(rmTest.getWay().firstNode())
    554                                                     || way.isFirstLastNode(rm.getWay().lastNode()))) {
    555                                                 direction = Direction.IRRELEVANT;
    556                                                 break;
    557                                         }
    558                                     }
     544                                if (direction == Direction.UNKNOWN && !way.getDataSet().getDataSourceBounds().isEmpty()
     545                                        && !(way.firstNode().isOutsideDownloadArea()
     546                                                || way.lastNode().isOutsideDownloadArea())) {
     547                                    // we know the connected ways, downloading more members will not help
     548                                    direction = Direction.IRRELEVANT;
    559549                                }
    560550                            }
Note: See TracChangeset for help on using the changeset viewer.