#geoDistance Calculates the distance between two points in units (default is kilometers).
geoDistance(point1, point2[, units])
Parameter | Description |
---|---|
Calculate the distance, in miles, between HarperDB’s headquarters and the Washington Monument.
Find all locations that are within 40 kilometers of a given point, return that distance in miles, and sort by distance in an ascending order.
point1
Required. GeoJSON Point specifying the origin.
point2
Required. GeoJSON Point specifying the destination.
units
Optional. Specified as a string. Options are ‘degrees’, ‘radians’, ‘miles’, or ‘kilometers’. Default is ‘kilometers’.