maxDistance static method

double maxDistance(
  1. List<Coordinate> pts,
  2. List<Coordinate> line
)

Computes the maximum distance out of a set of points to a linestring.

@param pts the points @param line the linestring vertices @return the maximum distance

Implementation

static double maxDistance(List<Coordinate> pts, List<Coordinate> line) {
  double maxDistance = 0;
  for (Coordinate p in pts) {
    double dist = Distance.pointToSegmentString(p, line);
    if (dist > maxDistance) {
      maxDistance = dist;
    }
  }
  return maxDistance;
}