Changeset 5995 in josm for trunk


Ignore:
Timestamp:
2013-06-07T00:05:07+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #4445, fix #5867 - revert r3784: allow merging of duplicate nodes even with unclosed geometries, as it is really needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r5503 r5995  
    8989    protected final static int DUPLICATE_NODE_MIXED = 2;
    9090    protected final static int DUPLICATE_NODE_OTHER = 3;
    91     protected final static int DUPLICATE_NODE_UNCLOSED = 4;
    9291    protected final static int DUPLICATE_NODE_BUILDING = 10;
    9392    protected final static int DUPLICATE_NODE_BOUNDARY = 11;
     
    173172            if (mm.get(tagSet).size() > 1) {
    174173
    175                 boolean oneWayClosed = false;
    176 
    177174                for (String type: types) {
    178175                    typeMap.put(type, false);
     
    187184                                boolean typed = false;
    188185                                Way w=(Way) sp;
    189                                 oneWayClosed = oneWayClosed || w.isClosed();
    190186                                Map<String, String> keys = w.getKeys();
    191187                                for (String type: typeMap.keySet()) {
     
    211207                }
    212208
    213                 if (!oneWayClosed) {
    214                     String msg = marktr("Duplicate nodes in two un-closed ways");
    215                     errors.add(new TestError(
    216                             parentTest,
    217                             Severity.WARNING,
    218                             tr("Duplicated nodes"),
    219                             tr(msg),
    220                             msg,
    221                             DUPLICATE_NODE_UNCLOSED,
    222                             mm.get(tagSet)
    223                             ));
    224                 } else if (nbType>1) {
     209                if (nbType>1) {
    225210                    String msg = marktr("Mixed type duplicated nodes");
    226211                    errors.add(new TestError(
     
    429414        // never merge nodes with different tags.
    430415        if (testError.getCode() == DUPLICATE_NODE) return false;
    431         // never merge nodes from two different non-closed geometries
    432         if (testError.getCode() == DUPLICATE_NODE_UNCLOSED) return false;
    433416        // everything else is ok to merge
    434417        return true;
Note: See TracChangeset for help on using the changeset viewer.