nearestPoints method

List<Coordinate?>? nearestPoints(
  1. Point pt
)

Gets the nearest locations between the geometry and a point. The first location lies on the geometry, and the second location is the provided point.

@param pt the point to compute the nearest location for @return a pair of locations

Implementation

List<Coordinate?>? nearestPoints(Point pt) {
  init();
  if (isInArea(pt)) {
    Coordinate? p = pt.getCoordinate();
    return [ p!.copy(), p.copy() ];
  }
  return facetDistance!.nearestPointsToGeometry(pt);
}