SQL Reference
Geospatial Functions
Spatiotemporal Measurement
{{ocientgeo}} s patiotemporal measurement functions can perform basic calculations on geospatial data that is paired with timestamp data st distance returns the two dimensional interpolated minimum simultaneous distance between two linestring timestamp array pairs in the specified unit of measurement if any argument is null or empty, the function returns null if either linestring timestamp array pair has a mismatched number of points and timestamps, the function returns an error behavior is undefined if either timestamp array is not monotonically increasing st distance(geo1, ts arr1, geo2, ts arr2, units \[, use spheroid] ) 135,174,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st distance( st linestring('linestring(0 0,0 12)'), timestamp \[]\( '2020 07 04 07 00 00 000000000', '2020 07 04 11 00 00 000000000'), st linestring('linestring(0 0,6 0)'), timestamp \[]\( '2020 07 04 08 00 00 000000000', '2020 07 04 10 00 00 00000000'), 'miles', true); output 206 124 to use st distance as a spatial function to calculate the minimum distance between two points, see the docid\ vgbw5fb dtz1vzsb6lria function in the spatial measurement section st maxdistance returns the two dimensional interpolated maximum cotemporal distance between two linestring timestamp array pairs in the specified unit of measurement if any argument is null or empty, the function returns null if either linestring timestamp array pair has a mismatched number of points and timestamps, the function returns an error behavior is undefined if either timestamp array is not monotonically increasing st maxdistance(geo1, ts arr1, geo2, ts arr2, units \[, use spheroid] ) 136,174,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st maxdistance( st linestring('linestring(0 0,0 12)'), timestamp\[]\('2020 07 04 07 00 00 000000000', '2020 07 04 11 00 00 000000000'), st linestring('linestring(0 0,6 0)'), timestamp\[]\('2020 07 04 08 00 00 000000000', '2020 07 04 10 00 00 00000000'), 'miles', true); output 743 83 to use st maxdistance as a spatial function to calculate the maximum distance between two points, see the docid\ vgbw5fb dtz1vzsb6lria function in the spatial measurement section st totalsecondsinintersection returns the total number of seconds spent in the intersection result calculated by the spatiotemporal version of docid\ m7egwhp4eqnp5gr81gvwq execute this function only with the result from st intersection if the input is an empty, correctly typed tuple, this function returns 0 seconds if the input is null, this function returns null st totalsecondsinintersection(tpl) 103,191,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st totalsecondsinintersection( st intersection( st linestring('linestring(1 1,2 2,1 1)'), timestamp\[]\( '2020 07 04 07 00 00 000000000', '2020 07 04 11 00 00 000000000', '2020 07 04 12 00 00 000000000'), st linestring('linestring(2 2,1 1)'))); output 18000 0 related links docid\ czxgepf3prq9ufwhwbiuy docid\ m7egwhp4eqnp5gr81gvwq