(Preview) Spatial Functions

Spatial functions enable you to perform geographical analysis when you model or analyze data. For example, you might calculate the distance between two geographical areas (known as shapes or polygons).

To use these functions in workbooks and data flows, make sure that your Oracle Analytics instance supports geometry data types. Ask your administrator to enable preview mode for Enable Geometry Data Type.

For guidance on visualizing spatial data, see 'Geometry Data Type (Preview)' in Technical Papers.

Function Example Description Syntax

GeometryArea

GeometryArea(Shape)

Calculates the area that a shape occupies.

GeometryArea(Shape)

GeometryAsText

GeometryAsText(shape)

GeometryAsText(GeometryPoint(longitude, latitude))

Converts the LONGVARBINARY values of a geometry column into Well-Known Text (WKT) format. GeometryAsText(shape_expr)

Where shape_expr represents any valid shape expression, including a GeometryPoint function.

GeometryDistance

GeometryDistance(TRIP_START, TRIP_END)

Calculates the distance between two shapes.

GeometryDistance(Shape 1, Shape 2)

GeometryLength

GeometryLength(Shape)

Calculates the circumference of a shape.

GeometryLength(Shape)

GeometryPoint

GeometryPoint(longitude, latitude) Creates a geometry data type in Point() format using longitude and latitude values. GeometryPoint(longitude, latitude)

Where longitude, latitude represent the longitude and latitude of a location.

GeometryRelate

GeometryRelate(TRIP_START, TRIP_END)

Determines whether one shape is inside another shape. Returns TRUE or FALSE as a string (varchar).

GeometryRelate(Shape 1, Shape 2)

GeometryWithinDistance

GeometryWithinDistance(TRIP_START, TRIP_END, 500)

Determines whether two shapes are within a specified distance of each other. Returns TRUE or FALSE as a string (varchar).

GeometryWithinDistance(Shape1, Shape2, DistanceInFloat)