geo:distance( $p1 as cts:point, $p2 as cts:point, [$options as xs:string*] ) as xs:double
Returns the distance (in units) between two points.
precision
option takes precedence over
that implied by the governing coordinate system name, including the
value of the coordinate-system
option. For example, if the
governing coordinate system is "wgs84/double" and the precision
option is "float", then the operation uses single precision.
let $sf := cts:point(37, -122) let $ny := cts:point(40, -73) return geo:distance($sf, $ny) => 2623.2017796533
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.