Ignore:
Timestamp:
2020-04-06T08:55:08+02:00 (4 years ago)
Author:
GerdP
Message:

fix #18863: split ways: false positive warnings about missing members

  • apply 18863-detect-broken.2.patch to detect the case that a complete way connected with the split-way shows that the relation order is broken. This check is only performed when the direct neighbours according to the relation are both incomplete anf if first and last node of split-way are inside download area.
File:
1 edited

Legend:

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

    r16200 r16242  
    473473            List<RelationMember> relationMembers = r.getMembers();
    474474            for (RelationMember rm : relationMembers) {
    475                 if (rm.isWay() && rm.getMember() == way) {
     475                if (rm.getMember() == way) {
    476476                    boolean insert = true;
    477477                    if (relationSpecialTypes.containsKey(type) && "restriction".equals(relationSpecialTypes.get(type))) {
     
    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                                    }
     559                                }
    544560                            }
    545561                        } else {
Note: See TracChangeset for help on using the changeset viewer.