Changeset 9381 in josm


Ignore:
Timestamp:
2016-01-10T03:23:50+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #12325 - Don't warn "highway link is not linked to adequate highway/link" for highways outside the download area

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
3 edited

Legend:

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

    r9371 r9381  
    1414
    1515import org.openstreetmap.josm.Main;
     16import org.openstreetmap.josm.actions.search.SearchCompiler.InDataSourceArea;
    1617import org.openstreetmap.josm.command.Command;
    1718import org.openstreetmap.josm.command.DeleteCommand;
     
    2425import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2526import org.openstreetmap.josm.tools.GBC;
     27import org.openstreetmap.josm.tools.Predicate;
    2628import org.openstreetmap.josm.tools.Utils;
    2729
     
    3739public class Test extends AbstractVisitor {
    3840
     41    protected static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new InDataSourceArea(false);
     42
    3943    /** Name of the test */
    4044    protected final String name;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java

    r8941 r9381  
    154154    public static boolean isHighwayLinkOkay(final Way way) {
    155155        final String highway = way.get("highway");
    156         if (highway == null || !highway.endsWith("_link")) {
     156        if (highway == null || !highway.endsWith("_link")
     157                || !IN_DOWNLOADED_AREA.evaluate(way.getNode(0)) || !IN_DOWNLOADED_AREA.evaluate(way.getNode(way.getNodesCount()-1))) {
    157158            return true;
    158159        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

    r9321 r9381  
    1313
    1414import org.openstreetmap.josm.Main;
    15 import org.openstreetmap.josm.actions.search.SearchCompiler.InDataSourceArea;
    1615import org.openstreetmap.josm.command.ChangePropertyCommand;
    1716import org.openstreetmap.josm.command.Command;
     
    2827import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2928import org.openstreetmap.josm.tools.Geometry;
    30 import org.openstreetmap.josm.tools.Predicate;
    3129
    3230/**
     
    4644    /** Values for {@code power} key interpreted as allowed power items */
    4745    protected static final Collection<String> POWER_ALLOWED_TAGS = Arrays.asList("switch", "transformer", "busbar", "generator", "switchgear");
    48 
    49     protected static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new InDataSourceArea(false);
    5046
    5147    private final Map<Way, String> towerPoleTagMap = new HashMap<>();
Note: See TracChangeset for help on using the changeset viewer.