Skip to main content
spatiotemporal operators perform calculations on geospatial data using an array of TIMESTAMP arguments.

ST_LONGESTLINE

With the specified two LINESTRING-TIMESTAMP ARRAY pairs, this function returns a two-point LINESTRING that represents the maximum distance between points at a concurrent time. If the two LINESTRING values do not overlap temporally, this function returns NULL. Syntax
SQL
Example
SQL
Output: LINESTRING(0 9, 8 0)
To use ST_LONGESTLINE as a spatial function to calculate the longest line between two points, see the ST_LONGESTLINE function.

ST_LINEGETALLTIMESATPOINT

Returns a timestamp array of all times when the specified LINESTRING value intersects the specified POINT value. If the line never intersects the point, then the function returns an empty timestamp array. If the specified inputs are NULL, the function returns NULL. This function cannot represent intervals of time where the line was stationary at a point, therefore, use this function only for mobile paths. If the path is stationary, use the ST_INTERSECTION function as it can represent intervals of time spent intersecting a stationary LINESTRING. Syntax
SQL
Example
SQL
Output: TIMESTAMP[]('2020-07-04 07:00:00.000000000', '2020-07-04 09:00:00.000000000')

ST_LINEGETPOINTATTIME

Returns a POINT within the bounds of the specified LINESTRING that corresponds to the interpolated point at the specified TIMESTAMP value. The specified TIMESTAMP value does not need to be an actual value explicitly included in the array. The function interpolates the corresponding point, which means that the function approximates the point coordinates from the surrounding values. The LINESTRING and TIMESTAMP array must be the same size. If the timestamp array is not monotonically increasing, the behavior is undefined. Syntax
SQL
Example
SQL
Output: POINT(2, 0)

ST_LINEGETTIMEATPOINT

Returns the interpolated time of the specified POINT on the specified LINESTRING that is paired with a TIMESTAMP ARRAY. The LINESTRING and TIMESTAMP ARRAY must be the same size. Syntax
SQL
Example
SQL
Output: TIMESTAMP('2020-07-04 07:30:00.000000000')

ST_INTERSECTION

Returns a tuple that represents the intersection of a spatiotemporal LINESTRING with a static geography. If the specified static geography is a POINT, the returned value is a tuple that contains a paired POINT array and TIMESTAMP array. If the specified static geography is a LINESTRING or POLYGON, then the returned value is a LINESTRING array paired with a two-dimensional TIMESTAMP array. Syntax
SQL
Example
SQL
Output: TUPLE(LINESTRING[](ST_LINESTRING('LINESTRING(2 2)'), ST_LINESTRING('LINESTRING(3 3)')), ARRAY[ARRAY[TIMESTAMP '2020-07-04 11:00:00.000000000'], ARRAY[TIMESTAMP '2020-07-04 12:00:00.000000000']])

ST_SHORTESTLINE

When you specify two LINESTRING-TIMESTAMP ARRAY pairs, this function returns a LINESTRING with two points that represents the minimum distance between points at a concurrent time. If the two linestrings do not overlap temporally, this function returns NULL. Syntax
SQL
Example
SQL
Output: LINESTRING(0.09295649430902601 0, 3.0461764508256914 0.37184471667525754)
To use ST_SHORTESTLINE as a spatial function to calculate the shortest line between two points, see the ST_SHORTESTLINE function.
Geospatial Data Types Spatiotemporal Measurement
Last modified on May 20, 2026