Skip to main content

GEO_SPATIAL_DISTANCE

Calculates the distance between two points

Updated today

Description

The GEO_SPATIAL_DISTANCE() function calculates the distance between two geometries

Syntax

GEO_SPATIAL_DISTANCE( Geometry 1, Geometry 2 [unit])

Output

number

Variables

  • geometry1: The first geometry in the distance calculation.

  • geometry2: The second geometry in the distance calculation.

  • unit (optional): The distance unit used for the calculation. Supported values are mi or km

Example

GEO_SPATIAL_DISTANCE ('customer_location' , 'store_location' , 'mi')

Customer Location

Store Location

Geo Spatial Distance

Point A

Point B

5.71

Point C

Point B

3.85

Point D

Point B

4.92

Did this answer your question?