Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Jun 21, 2024
1 parent 51213c0 commit d572afe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class BikeCommonPriorityParser implements TagParser {
int avoidSpeedLimit;
EnumEncodedValue<RouteNetwork> bikeRouteEnc;
Map<RouteNetwork, Integer> routeMap = new HashMap<>();
protected final Set<String> goodSurface = new HashSet<>(List.of("paved", "asphalt", "concrete"));
protected final Set<String> goodSurface = Set.of("paved", "asphalt", "concrete");

// This is the specific bicycle class
private String classBicycleKey;
Expand Down Expand Up @@ -154,11 +154,9 @@ private PriorityCode convertClassValueToPriority(String tagvalue) {
*/
void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, PriorityCode> weightToPrioMap) {
String highway = way.getTag("highway");
boolean isTracTypeGrade1 = way.getTag("tracktype", "").equals("grade1");
boolean isGoodSurface = goodSurface.contains(way.getTag("surface",""));
if (isDesignated(way)) {
if ("path".equals(highway) ||
("track".equals(highway) && (isTracTypeGrade1 || isGoodSurface )))
boolean isGoodSurface = way.getTag("tracktype", "").equals("grade1") || goodSurface.contains(way.getTag("surface",""));
if ("path".equals(highway) || "track".equals(highway) && isGoodSurface)
weightToPrioMap.put(100d, VERY_NICE);
else
weightToPrioMap.put(100d, PREFER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, PriorityCode> w
String highway = way.getTag("highway");
if ("track".equals(highway)) {
String trackType = way.getTag("tracktype");
boolean isGoodSurface = goodSurface.contains(way.getTag("surface",""));
if ("grade1".equals(trackType) || isGoodSurface)
if ("grade1".equals(trackType) || goodSurface.contains(way.getTag("surface","")))
weightToPrioMap.put(50d, SLIGHT_PREFER);
else if (trackType == null)
weightToPrioMap.put(90d, PREFER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ void collect(ReaderWay way, double wayTypeSpeed, TreeMap<Double, PriorityCode> w
if ("service".equals(highway) || "residential".equals(highway)) {
weightToPrioMap.put(40d, SLIGHT_AVOID);
} else if ("track".equals(highway)) {
boolean isGoodSurface = goodSurface.contains(way.getTag("surface",""));
String trackType = way.getTag("tracktype");
if ("grade1".equals(trackType) || isGoodSurface )
if ("grade1".equals(trackType) || goodSurface.contains(way.getTag("surface","")))
weightToPrioMap.put(110d, VERY_NICE);
else if (trackType == null || trackType.startsWith("grade"))
weightToPrioMap.put(110d, AVOID_MORE);
Expand Down

0 comments on commit d572afe

Please sign in to comment.