double[] distances = shapePoints.getDistTraveled();
int index = stop.getShapePointIndex();
if (index + 1 == lats.length)
return new CoordinatePoint(lats[index], lons[index]);
double d1 = distances[index];
double d2 = distances[index + 1];
if (d1 == d2)
return new CoordinatePoint(lats[index], lons[index]);
double ratio = (stop.getShapeDistTraveled() - d1) / (d2 - d1);
double lat = InterpolationLibrary.interpolatePair(lats[index],
lats[index + 1], ratio);
double lon = InterpolationLibrary.interpolatePair(lons[index],
lons[index + 1], ratio);
return new CoordinatePoint(lat, lon);
}