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
| Category | Details |
|---|---|
| Number of Arguments | 2 |
| Mandatory Argument Names and Datatypes |
|
| Optional Argument Names and Datatypes | N/A |
| Modifiers | output 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
| Category | Details |
|---|---|
| Number of Arguments | 2 |
| Mandatory Argument Names and Datatypes |
|
| Optional Argument Names and Datatypes | N/A |
| Modifiers | N/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
| Category | Details |
|---|---|
| Number of Arguments | 2 |
| Mandatory Argument Names and Datatypes |
|
| Optional Argument Names and Datatypes | N/A |
| Modifiers | N/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