Loading TOC...

MarkLogic 9 Product Documentation
geo:distance-convert

geo:distance-convert(
   $distance as xs:double,
   $unit1 as xs:string,
   $unit2 as xs:string
) as xs:double

Summary

This function converts a distance from one unit of measure to another. The supported units are "miles", "feet", "km", and "meters". This is a proper superset of the units supported as options to various geospatial functions ("miles","km").

Parameters
distance The distance.
unit1 The unit of the input distance parameter.
unit2 The unit to which the distance should be converted.

See Also

Example

geo:distance-convert(100, "meters", "miles")

=> 0.0621371192237334032

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.