distance
Computes the Cartesian distance between geometry a and geometry b.
Distance is in input geometry units.
Parameters
| Name | Type | Description |
|---|---|---|
a | Geometry | Prepared<Geometry> | First geometry |
b | Geometry | Second geometry |
Returns
number
The distance between geometries
Throws
See also
distanceWithinreturnstruewhen two geometries are within a given distancenearestPointsfinds the nearest points of two geometriesprepareimproves performance of repeated calls against a single geometry
Examples
distance between point and line
distance between line and polygon
distance between two polygons