nearestPoints
Finds the nearest points between geometry a and geometry b.
The returned points can be points along a line segment, not necessarily one of the vertices of the input geometries.
Parameters
| Name | Type | Description |
|---|---|---|
a | Geometry | Prepared<Geometry> | First geometry |
b | Geometry | Second geometry |
Returns
[ Point, Point ]
An array with two point geometries, first is the nearest point
from the geometry a second from the geometry b
Throws
See also
distancecomputes the distance between two geometriesdistanceWithinreturnstruewhen two geometries are within a given distanceprepareimproves performance of repeated calls against a single geometry
Examples
nearest points between point and line
nearest points between two polygons