Loading TOC...

geo.distance

geo.distance(
   $p1 as cts.point,
   $p2 as cts.point,
   [$options as String[]]
) as Number

Summary

Returns the distance (in miles) between two points.

Parameters
$p1 The first point.
$p2 The second point.
$options Options for the operation. The default is ().

Options include:

"coordinate-system=string"
Use the given coordinate system. Valid values are:
wgs84
The WGS84 coordinate system.
raw
The raw (unmapped) coordinate system.
"units=miles"
Distance is measured in miles.

Example

var sf = cts.point(37, -122);
var ny = cts.point(40, -73);
geo.distance(sf, ny);

=> 2623.2017796533

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy