Changeset 6870 in josm


Ignore:
Timestamp:
2014-02-18T19:24:21+01:00 (6 years ago)
Author:
simon04
Message:

fix #9598 - Validator: do not report "Overlapping ways" for buildings

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r6862 r6870  
    2828import org.openstreetmap.josm.tools.MultiMap;
    2929import org.openstreetmap.josm.tools.Pair;
     30import org.openstreetmap.josm.tools.Predicates;
     31import org.openstreetmap.josm.tools.Utils;
    3032
    3133/**
     
    152154        // see ticket #9598 - only report if at least 3 segments are shared
    153155        for (TestError error : preliminaryErrors) {
    154             if (error.getHighlighted().size() / error.getPrimitives().size() >= 3) {
     156            if (error.getHighlighted().size() / error.getPrimitives().size() >= 3
     157                    && !Utils.exists(error.getPrimitives(), Predicates.hasKey("building"))) {
    155158                errors.add(error);
    156159            }
  • trunk/src/org/openstreetmap/josm/tools/Predicates.java

    r6652 r6870  
    8787
    8888    /**
     89     * Returns a {@link Predicate} executing {@link OsmPrimitive#hasKey(String)}.
     90     */
     91    public static Predicate<OsmPrimitive> hasKey(final String key) {
     92        return new Predicate<OsmPrimitive>() {
     93            @Override
     94            public boolean evaluate(OsmPrimitive p) {
     95                return p.hasKey(key);
     96            }
     97        };
     98    }
     99
     100    /**
    89101     * Returns a {@link Predicate} executing {@link Collection#contains(Object)}.
    90102     */
Note: See TracChangeset for help on using the changeset viewer.