Changeset 29633 in osm


Ignore:
Timestamp:
2013-06-07T00:25:41+02:00 (12 years ago)
Author:
donvip
Message:

[josm_routing] fix #josm2475 - exclude irrelevant highway tags from routing graph, like construction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java

    r29629 r29633  
    2929
    3030import java.util.ArrayList;
     31import java.util.Arrays;
     32import java.util.Collection;
    3133import java.util.List;
    3234import java.util.Map;
     
    8890        static Logger logger = Logger.getLogger(RoutingGraph.class);
    8991
     92    private static Collection<String> excludedHighwayValues = Arrays.asList(new String[]{
     93        "bus_stop", "traffic_signals", "street_lamp", "stop", "construction",
     94        "platform", "give_way", "proposed", "milestone", "speed_camera", "abandoned"
     95    });
     96       
    9097        /**
    9198         * Graph state
     
    320327                //if (!way.isTagged())            <---not needed me thinks
    321328                //    return false;
    322 
    323                 return way.get("highway") != null || way.get("junction") != null
     329           
     330            String highway = way.get("highway");
     331
     332                return (highway != null && !excludedHighwayValues.contains(highway)) || way.get("junction") != null
    324333                                || way.get("service") != null;
    325334
Note: See TracChangeset for help on using the changeset viewer.