Geospatial Functions

AMPS includes a function for calculating the distance from a signed latitude and longitude.

FunctionParametersDescription

GEO_DISTANCE

first_latitude, first_longitude, second_latitude, second_longitude

Returns a double that contains the distance between the point identified by first_latitude, first_longitude and second_latitude, second_longitude in meters.

For example, given a home point and a message containing /lat and /long fields, you could use the following expression to calculate the distance from home.

 GEO_DISTANCE( /lat, /long, 40.786337, -119.206508) 

AMPS uses the haversine formula when computing distances.

Last updated

Copyright 2013-2024 60East Technologies, Inc.