Skip to main content
Version: 2.15.X

Spatial Functions

Spatial functions help process and evaluate geometrical and geographical data.

The examples for each function use the following notation:

  • Square brackets ([]) indicate arrays.
  • Curly braces ({}) indicate groups.
  • Arrows (==>) separate inputs and outputs. Inputs are shown on the left side of the arrow. Outputs are shown on the right side of the arrow.

Distance

The Distance function returns the distance between two geo-coordinates using the selected output units (miles or kilometers).

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • coord1: The first geo-coordinate.
  • coord2: The second geo-coordinate.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and DatatypesN/A
Modifiersoutput unit (Default: mi): The unit of measurement for the output. The available options are mi (miles) and km (kilometers).
Output Datatype(s)Float

Examples

distance(coord,coord) ==> 3.4

distance([coord,coord,coord],coord) ==> [3.4,2.2,68.9]
distance(coord,[coord,coord,coord]) ==> [3.4,2.2,68.9]

distance({coord,coord,coord},coord) ==> {3.4,2.2,68.9}
distance({coord,coord,coord},{coord,coord,coord}) ==> {3.4,2.2,68.9}

Geo Contains

The Geo Contains function returns True if the specified coordinate (coord) is within the bounds of the specified polygon (geo-poly). Otherwise, it returns False.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • geo-poly: A GeoJSON indicating the bounds of the polygon.
  • coord: A GeoJSON indicating the coordinate to check.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Boolean

Examples

geoContains(geo-poly,coord) ==> False

geoContains([geo-poly,geo-poly,geo-poly],coord) ==> [True,False,False]
geoContains(geo-poly,[coord,coord,coord]) ==> [False,True,False]

geoContains({geo-poly,geo-poly,geo-poly},coord) ==> {True,False,False}
geoContains({poly,poly,poly},{coord,coord,coord}) ==> {True,True,False}

Make Geo Point

The Make Geo Point function converts the submitted latitude and longitude into a single geo-coordinate point.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • longitude: A float indicating the geo point's longitude.
  • latitude: A float indicating the geo point's latitude.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Geo-coordinate

Examples

makeGeoPoint(longitude=54.2,latitude=-32.4) ==> geo-coordinate
makeGeoPoint(longitude={54.2,42.6,-23.1},latitude={-32.4,12.3,-49,3}) ==> geo-coordinate