All Products
Search
Document Center

:Spatio-temporal functions

Last Updated:Jan 23, 2025

Spatio-temporal functions analyze and calculate spatio-temporal data in scenarios that require spatio-temporal range query, geofence determination, and spatio-temporal data mining, such as ride-hailing, urban traffic planning, and navigation. This topic describes the spatio-temporal functions supported by the Lindorm streaming engine.

Category

Function

Description

Output functions

ST_AsText

Returns the information about a geometry object in Well-known Text (WKT) format.

Constructor functions

ST_GeomFromText

Constructs a geometry object based on the specified WKT string.

ST_LineFromMultiPoint

Constructs a LineString object based on the specified MultiPoint object.

ST_MakePoint

Constructs a point object.

ST_MakeLine

Constructs a LineString object.

Access functions

ST_Centroid

Returns the centroid of the specified geometry object.

ST_EndPoint

Returns the last point of the specified LineString object.

ST_NPoints

Returns the number of vertexes in the specified geometry object.

ST_StartPoint

Returns the start point of the specified LineString object.

ST_X

Returns the x coordinate of the specified point object.

ST_XMax

Returns the maximum x coordinate on the bounding box of the specified geometry object.

ST_XMin

Returns the minimum x coordinate on the bounding box of the specified geometry object.

ST_Y

Returns the y coordinate of the specified point object.

ST_YMax

Returns the maximum y coordinate on the bounding box of the specified geometry object.

ST_YMin

Returns the minimum y coordinate on the bounding box of the specified geometry object.

Functions for spatial relationships

ST_Contains

Checks whether the first geometry object that you specify contains the second geometry object that you specify. If the first geometry object contains the second geometry object, this function returns true.

ST_DWithin

Checks whether the 2D distance between two geometry objects is within the specified range. If the 2D distance between the objects is within the specified range, this function returns true.

ST_DWithinSphere

Checks whether the spherical distance between two geometry objects is within the specified range. If the spherical distance between the objects is within the specified range, this function returns true.

ST_Intersects

Checks whether two geometry objects intersect. If the two geometry objects have any shared spatial space, this function determines that the two objects intersect and returns true.

ST_Overlaps

Checks whether two geometry objects spatially overlap but one is not contained in the other. If the two geometry objects spatially overlap but one is not contained in the other, this function returns true.

ST_Within

Checks whether the second geometry object that you specify is completely within the first geometry object that you specify. If the second geometry object is completely within the first geometry object, this function returns true.

ST_Equals

Checks whether two geometry objects are spatially equal. If the two geometry objects are spatially equal, this function returns true.

Processing functions

ST_Buffer

Returns a buffer geometry object consisting of all points whose 2D distance to a specified source geometry object is equal to the specified radius.

ST_BufferSphere

Returns a buffer geometry object consisting of all points whose spherical distance to a specified source geometry object is equal to the specified radius.

ST_Difference

Returns a geometry object representing the part that the first geometry object that you specify does not intersect with the second geometry object that you specify.

ST_MinimumBoundingCircle

Returns the smallest circle that can fully contain the specified geometry object.

ST_MinimumBoundingRadius

Returns the radius of the smallest circle that can fully contain the specified geometry object.

ST_Intersection

Returns a geometry object representing the part that the first geometry object that you specify intersects with the second geometry object that you specify.

Measurement functions

ST_Area

Calculates the area of the specified polygon object.

ST_Distance

Calculates the 2D Euclidean distance between two specified geometry objects. The returned distance is measured in degrees.

ST_DistanceSphere

Calculates the minimum spherical distance between two specified geometry objects. The returned distance is measured in meters. If one of the specified geometry object is a polygon or LineString object, the results may have an error of centimeters.

ST_Length

Calculates the 2D length of the specified geometry object. The returned length is measured in degrees.

ST_LengthSphere

Calculates the spherical length of the specified geometry object. The returned length is measured in meters.

Aggregate functions

ST_MakeLine_Agg

Constructs a LineString object based on the specified geometry object. This function does not sort the data.

ST_MakeLine_Ts_Agg

Constructs a LineString object based on the specified geometry object and sorts data based on the timestamp column.