org.opentripplanner.graph_builder.module.extra_elevation_data.ElevationPoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.graph_builder.module.extra_elevation_data;
public class ElevationPoint implements Comparable {
public double distanceAlongShape, ele;
public ElevationPoint(double distance, double ele) {
this.distanceAlongShape = distance;
this.ele = ele;
}
public ElevationPoint fromBack(double length) {
return new ElevationPoint(length - distanceAlongShape, ele);
}
@Override
public int compareTo(ElevationPoint arg0) {
return (int) Math.signum(distanceAlongShape - arg0.distanceAlongShape);
}
public String toString() {
return "ElevationPoint(" + distanceAlongShape + ", " + ele + ")";
}
}