double[] lats = points.getLats();
double[] lons = points.getLons();
double[] dist = points.getDistTraveled();
if (index == 0)
return new CoordinatePoint(lats[0], lons[0]);
if (index == n)
return new CoordinatePoint(lats[n - 1], lons[n - 1]);
if (dist[index] == dist[index - 1])
return new CoordinatePoint(lats[n - 1], lons[n - 1]);
double ratio = (_shapeDistanceTraveled - dist[index - 1])
/ (dist[index] - dist[index - 1]);
double lat = ratio * (lats[index] - lats[index - 1]) + lats[index - 1];
double lon = ratio * (lons[index] - lons[index - 1]) + lons[index - 1];
return new CoordinatePoint(lat, lon);
}