nearest
Returns the geometry with the minimum distance to the query geometry.
Cartesian distance is calculated between the actual geometries, not their bounding boxes.
If there are multiple equidistant geometries, this function will return
only one of them. To return all such geometries, use nearestAll.
Parameters
| Name | Type | Description |
|---|---|---|
geometry | Geometry | Geometry for which the nearest neighbor is queried |
Returns
G | undefined
The nearest geometry or undefined if the tree is empty
Throws
GEOSErrorif any of the considered candidates for the nearest geometry is one of unsupported geometry types (curved)