Skip to main content

closestPoints (Stream Function)

Returns the closest coordinate to geo.json.geometry.fence.

Syntax​

geo:closestPoints(<DOUBLE> longitude, <DOUBLE> latitude, <STRING> geo.json.geometry.fence)

Query Parameters​

NameDescriptionPossible Data TypesOptionalDynamic
longitudeLongitude of the geo location.DOUBLENoNo
latitudeLatitude of the geo location.DOUBLENoNo
geo.json.geometry.fenceString that contains geometry type and coordinates for a GeoJSON geometry fence.StringNoNo

Extra Return Attributes​

NameDescriptionPossible Data Types
closestPointOf1From2Latitudeclosest point's latitude to the fence from the location.DOUBLE
closestPointOf1From2Longitudeclosest point's longitude to the fence from the location.DOUBLE
closestPointOf2From1Latitudeclosest point's latitude to the location from the fence.DOUBLE
closestPointOf2From1Longitudeclosest point's longitude to the location from the fence.DOUBLE

Example​

geo:closestPoints(0.5,0.5,"{'type':'Polygon','coordinates':[[[0,0],[0,2],[1,2],[1,0],[0,0]]]}")

This example returns 0.5, 0.5, 0.5, 0.5.