Coordinate routeProjectedEndCoord = routeProjectedEndIndex
.getCoordinate(routeGeometry);
if (routeProjectedEndIndex.compareTo(routeIndex) <= 0) {
try {
routeProjectedEndIndex = indexedRoute.indexOfAfter(routeProjectedEndCoord,
routeIndex);
if (Double.isNaN(routeProjectedEndIndex.getSegmentFraction())) {
// can't go forward
routeProjectedEndIndex = routeIndex; // this is bad, but not terrible
// since we are advancing along the edge