for (int i = 0; i < lineCoord.length - 1; i++) {
double dist = CGAlgorithms3D.distancePointSegment(coord, lineCoord[i],
lineCoord[i + 1]);
if (dist < minDistance) {
LineSegment seg = new LineSegment(lineCoord[i], lineCoord[i + 1]);
Coordinate segClosestPoint = seg.closestPoint(coord);
updateDistance(dist,
new GeometryLocation(line, i, segClosestPoint),
new GeometryLocation(point, 0, coord),
flip);
}