routingalternatives: consider transit options
This commit is contained in:
@@ -10,5 +10,19 @@ public enum Modality {
|
||||
TRAIN,
|
||||
CAR,
|
||||
MOTORCYCLE,
|
||||
TAXI
|
||||
TAXI;
|
||||
|
||||
public static Modality fromCartaString(String cartaType) {
|
||||
return switch (cartaType.toLowerCase()) {
|
||||
case "tram", "subway" -> TRAM;
|
||||
case "rail", "monorail" -> TRAIN;
|
||||
case "bus", "trolleybus" -> BUS;
|
||||
case "ferry", "cablecar", "gondola", "funicular" ->
|
||||
throw new UnsupportedOperationException("Transport type needs to be added to backend: " + cartaType);
|
||||
// these are to dervive modality from carta step type
|
||||
case "walkingstep" -> WALKING;
|
||||
case "cyclingstep" -> BICYCLE;
|
||||
default -> throw new IllegalArgumentException("Unknown CARTA modality: " + cartaType);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user