GEODISTANCE_COSINE Function

Computes the distance between two geographical points. This function provides results faster and provides an acceptable level of accuracy for most cases.

Category: Information and Conversion Functions

Syntax

geodistance_cosine(<lat1, lon1, lat2, lon2>)

Required Arguments

lat1

latitude for first location, in decimal degrees. South latitudes are negative

lon1

longitude for first location, in decimal degrees. East longitudes are positive

lat2

latitude for second location, in decimal degrees. South latitudes are negative

lon2

longitude for second location, in decimal degrees. East longitudes are positive

Details

The geodistance_cosine function is used to compute the distance between two geographical points.

Note: Each point is represented using latitude and longitude in decimal degrees. South latitudes are negative and east longitudes are positive. The function returns -1 when there is an error.

Example

geodistance_cosine(21.349017, -45.566906, -35.203839, 19.996602)