/** * In this method we prefer cycleways or roads with designated bike access and avoid big roads * or roads with trams or pedestrian. * <p> * * @return new priority based on priorityFromRelation and on the tags in ReaderWay. */ protected int handlePriority(ReaderWay way, double wayTypeSpeed, int priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>(); if (priorityFromRelation == 0) weightToPrioMap.put(0d, UNCHANGED.getValue()); else weightToPrioMap.put(110d, priorityFromRelation); collect(way, wayTypeSpeed, weightToPrioMap); // pick priority with biggest order value return weightToPrioMap.lastEntry().getValue(); }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("service".equals(highway)) { weightToPrioMap.put(40d, UNCHANGED.getValue()); } else if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(110d, PREFER.getValue()); else if (trackType == null || trackType.startsWith("grade")) weightToPrioMap.put(110d, AVOID_AT_ALL_COSTS.getValue()); } }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(50d, UNCHANGED.getValue()); else if (trackType == null) weightToPrioMap.put(90d, PREFER.getValue()); else if (trackType.startsWith("grade")) weightToPrioMap.put(100d, VERY_NICE.getValue()); } }
/** * In this method we prefer cycleways or roads with designated bike access and avoid big roads * or roads with trams or pedestrian. * <p> * * @return new priority based on priorityFromRelation and on the tags in ReaderWay. */ protected int handlePriority(ReaderWay way, double wayTypeSpeed, int priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<Double, Integer>(); if (priorityFromRelation == 0) weightToPrioMap.put(0d, UNCHANGED.getValue()); else weightToPrioMap.put(110d, priorityFromRelation); collect(way, wayTypeSpeed, weightToPrioMap); // pick priority with biggest order value return weightToPrioMap.lastEntry().getValue(); }
/** * In this method we prefer cycleways or roads with designated bike access and avoid big roads * or roads with trams or pedestrian. * <p> * * @return new priority based on priorityFromRelation and on the tags in ReaderWay. */ protected int handlePriority(ReaderWay way, double wayTypeSpeed, int priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>(); if (priorityFromRelation == 0) weightToPrioMap.put(0d, UNCHANGED.getValue()); else weightToPrioMap.put(110d, priorityFromRelation); collect(way, wayTypeSpeed, weightToPrioMap); // pick priority with biggest order value return weightToPrioMap.lastEntry().getValue(); }
/** * In this method we prefer cycleways or roads with designated bike access and avoid big roads * or roads with trams or pedestrian. * <p> * @return new priority based on priorityFromRelation and on the tags in OSMWay. */ protected int handlePriority( OSMWay way, double wayTypeSpeed, int priorityFromRelation ) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<Double, Integer>(); if (priorityFromRelation == 0) weightToPrioMap.put(0d, UNCHANGED.getValue()); else weightToPrioMap.put(110d, priorityFromRelation); collect(way, wayTypeSpeed, weightToPrioMap); // pick priority with biggest order value return weightToPrioMap.lastEntry().getValue(); }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("service".equals(highway)) { weightToPrioMap.put(40d, UNCHANGED.getValue()); } else if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(110d, PREFER.getValue()); else if (trackType == null || trackType.startsWith("grade")) weightToPrioMap.put(110d, AVOID_AT_ALL_COSTS.getValue()); } }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("service".equals(highway)) { weightToPrioMap.put(40d, UNCHANGED.getValue()); } else if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(110d, PREFER.getValue()); else if (trackType == null || trackType.startsWith("grade")) weightToPrioMap.put(110d, AVOID_AT_ALL_COSTS.getValue()); } }
@Override void collect( OSMWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap ) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("service".equals(highway)) { weightToPrioMap.put(40d, UNCHANGED.getValue()); } else if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(110d, PREFER.getValue()); else if (trackType == null || trackType.startsWith("grade")) weightToPrioMap.put(110d, AVOID_AT_ALL_COSTS.getValue()); } }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(50d, UNCHANGED.getValue()); else if (trackType == null) weightToPrioMap.put(90d, PREFER.getValue()); else if (trackType.startsWith("grade")) weightToPrioMap.put(100d, VERY_NICE.getValue()); } }
@Override void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(50d, UNCHANGED.getValue()); else if (trackType == null) weightToPrioMap.put(90d, PREFER.getValue()); else if (trackType.startsWith("grade")) weightToPrioMap.put(100d, VERY_NICE.getValue()); } }
@Override void collect( OSMWay way, double wayTypeSpeed, TreeMap<Double, Integer> weightToPrioMap ) { super.collect(way, wayTypeSpeed, weightToPrioMap); String highway = way.getTag("highway"); if ("track".equals(highway)) { String trackType = way.getTag("tracktype"); if ("grade1".equals(trackType)) weightToPrioMap.put(50d, UNCHANGED.getValue()); else if (trackType == null) weightToPrioMap.put(90d, PREFER.getValue()); else if (trackType.startsWith("grade")) weightToPrioMap.put(100d, VERY_NICE.getValue()); } }