Spatial Functions

Version:
2021.3
Last modified: August 16, 2021

A spatial function builds spatial objects, analyzes spatial data, and returns metrics from spatial fields. A spatial function can only be used with Spatial data types.

Spatial Functions are consistent with the Open GIS Consortium, Inc. For more information, visit http://portal.opengeospatial.org/files/?artifact_id=829.

Spatial objects in formulas can use these operators:

  • + (plus)
  • - (minus)
  • == (equals)
  • != (not equal)

ST_Area

ST_Area(object, units): Returns the area of the spatial object in the specified units (numeric data value).

ST_Boundary

ST_Boundary(object): Returns the boundary of the spatial object (polyline spatial object indicating the boundary of the input polygon).

ST_BoundingRectangle

ST_BoundingRectangle(object, ...): Returns the bounding rectangle of the spatial object (polygon spatial object).

Example

Thumbnail

ST_Centroid

ST_Centroid(object): Returns the centroid of the spatial object (point spatial object).

ST_CentroidX

ST_CentroidX(object): Returns the longitude of the centroid of the spatial object (numeric data value).

ST_CentroidY

ST_CentroidY(object): Returns the latitude of the centroid of the spatial object (numeric data value).

ST_Combine

ST_Combine(object1, object2,...): Combines the spatial objects (spatial object).

Example

Thumbnail

ST_Contains

ST_Contains(object1,object2): Returns True if object1 contains object2 (Boolean value).

ST_ConvexHull

ST_ConvexHull(object1,...): Returns the convex hull of the spatial objects (spatial object).

Example

Thumbnail

ST_CreateLine

ST_CreateLine(point1, point2...): Creates a line by connecting the specified points and lines in a sequence (spatial object).

ST_CreatePoint

ST_CreatePoint(x,y): Returns a spatial object containing the specified longitude and latitude coordinates (spatial object).

ST_CreatePolygon

ST_CreatePolygon(obj1, obj2...): Creates a polygon by connecting the specified points and lines in a sequence (spatial object).

ST_Cut

ST_Cut(object1,object2): Returns the result of cutting object1 from object2 (spatial object).

Example

Thumbnail

ST_Dimension

ST_Dimension(object): Returns the dimension of the spatial object. The spatial dimension is the minimum number of coordinates needed to specify every point that makes up the spatial object (numeric data value).

  • Point objects return a value of 0.
  • Line objects return a value of 1.
  • Polygon objects return a value of 2

ST_Distance

ST_Distance(object1, object2, units): Returns the distance from object1 to object2 in the specified units. Supported units are Miles (Mi), Kilometers (KM), Meters, and Feet (numeric data value).

ST_EndPoint

ST_EndPoint(object): Returns the last point of the spatial object (point spatial object).

ST_Intersection

ST_Intersection(object1, object2, ...): Returns the intersection of the specified spatial objects (spatial object).

ST_Intersects

ST_Intersects(object1, object2...): Returns True if the spatial objects intersect (Boolean value).

ST_InverseIntersection

ST_InverseIntersection(object1, object2...): Returns the inverse intersection of the specified spatial objects (spatial object).

ST_Length

ST_Length(object, units): Returns the linear length of the spatial object in the specified units (numeric data value).

ST_MD5

ST_MD5(object): Calculates the MD5 hash of the spatial object.

ST_MaxX

ST_MaxX(object): Returns the maximum longitude of the spatial object (numeric data value).

ST_MaxY

ST_MaxY(object): Returns the maximum latitude of the spatial object (numeric data value).

ST_MinX

ST_MinX(object): Returns the minimum longitude of the spatial object (numeric data value).

ST_MinY

ST_MinY(object): Returns the minimum latitude of the spatial object (numeric data value).

ST_NumParts

ST_NumParts(object): Returns the number of parts in the spatial object (numeric data value).

ST_NumPoints

ST_NumPoints(object): Returns the number of points in the spatial object (numeric data value).

ST_ObjectType

ST_ObjectType(object): Returns the spatial object type as a string value (string data value).

ST_PointN

ST_PointN(object, n): Returns the Nth point in the spatial object (point spatial object).

ST_RandomPoint

ST_RandomPoint(object): Returns a random point within the spatial object (point spatial object).

ST_Relate

ST_Relate(object1,object2,relation): Returns True if the objects satisfy the provided DE-9IM relation (Boolean value).

ST_StartPoint

ST_StartPoint(object): Returns the first point in the spatial object (spatial object).

ST_Touches

ST_Touches(object1, object2): Returns True if object1 touches object2 (Boolean value).

ST_TouchesOrIntersects

ST_TouchesOrIntersects(object1, object2): Returns True if object1 touches or intersects object2 (Boolean value).

ST_Within

ST_Within(object1, object2): Returns True if object1 is contained by object2 (Boolean value).

Was This Page Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support. Can't submit this form? Email us.