diff --git a/src/main/java/org/opentripplanner/graph_builder/annotation/HopSpeedFast.java b/src/main/java/org/opentripplanner/graph_builder/annotation/HopSpeedFast.java index 2b443322c87..51df61f4dcf 100644 --- a/src/main/java/org/opentripplanner/graph_builder/annotation/HopSpeedFast.java +++ b/src/main/java/org/opentripplanner/graph_builder/annotation/HopSpeedFast.java @@ -19,10 +19,10 @@ public class HopSpeedFast extends GraphBuilderAnnotation { private static final long serialVersionUID = 1L; - public static final String FMT = "Excessive speed of %f m/sec over %fm on route %s trip %s " + + public static final String FMT = "Excessive speed of %f kph over %fm on route %s trip %s " + "stop sequence %d."; - final float speed; + final float metersPerSecond; final float distance; @@ -30,8 +30,8 @@ public class HopSpeedFast extends GraphBuilderAnnotation { final int seq; - public HopSpeedFast(float speed, float distance, Trip trip, int seq){ - this.speed = speed; + public HopSpeedFast(float metersPerSecond, float distance, Trip trip, int seq){ + this.metersPerSecond = metersPerSecond; this.distance = distance; this.trip = trip; this.seq = seq; @@ -39,7 +39,8 @@ public HopSpeedFast(float speed, float distance, Trip trip, int seq){ @Override public String getMessage() { - return String.format(FMT, speed, distance, trip.getRoute(), trip, seq); + int kph = (int)(3.6 * metersPerSecond); // convert meters per second to kph + return String.format(FMT, kph, distance, trip.getRoute(), trip, seq); } }