Return the smallest distance ever
{geo,cbuffer,tcbuffer,stbox} |=| {geo,cbuffer,tcbuffer,stbox} → float
The operator |=| that can be used for doing nearest neightbor searches using a GiST or an SP-GiST index (see the section called “Indexing”).
SELECT tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]' |=| geometry 'Linestring(50 50,55 55)'; -- 67.58225099390856 SELECT tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]' |=| cbuffer 'Cbuffer(Point(1 1), 0.5)'; -- 0.6142135623730951
Return the instant of the first temporal circular buffer at which the two arguments are at the nearest distance
nearestApproachInstant({geo,cbuffer,tcbuffer},{geo,cbuffer,tcbuffer}) → tcbuffer
SELECT nearestApproachInstant(tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]', geometry 'Linestring(50 50,55 55)'); -- Cbuffer(POINT(2 2),0.349928)@2001-01-01 02:59:44.402905 SELECT nearestApproachInstant(tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]', cbuffer 'Cbuffer(Point(1 1), 0.5)'); -- Cbuffer(POINT(2 2),0.592181)@2001-01-01 17:31:51.080405
Return the line connecting the nearest approach point between the two arguments
shortestLine({geo,cbuffer,tcbuffer},{geo,cbuffer,tcbuffer}) → geometry
The function will only return the first line that it finds if there are more than one
SELECT ST_AsText(shortestLine(tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]', geometry 'Linestring(50 50,55 55)')); -- LINESTRING(50 50,2.212132034355964 2.212132034355964) SELECT ST_AsText(shortestLine(tcbuffer '[Cbuffer(Point(2 2), 0.3)@2001-01-01, Cbuffer(Point(2 2), 0.7)@2001-01-02]', cbuffer 'Cbuffer(Point(1 1), 0.5)')); -- LINESTRING(1.353553390593274 1.353553390593274,1.787867965644036 1.787867965644036)
Return the temporal distance
{geo,cbuffer} <-> tcbuffer → tfloat
tcbuffer <-> {geo,cbuffer,tcbuffer} → tfloat
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-01, Cbuffer(Point(1 1), 0.5)@2001-01-03]' <-> cbuffer 'Cbuffer(Point(1 1), 0.2)'; -- [0@2001-01-01, 0@2001-01-03] SELECT tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-01, Cbuffer(Point(1 1), 0.5)@2001-01-03]' <-> geometry 'Point(50 50)'; -- [68.99646455628167@2001-01-01, 68.79646455628166@2001-01-03] SELECT tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-01, Cbuffer(Point(1 1), 0.5)@2001-01-03]' <-> tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-02, Cbuffer(Point(1 1), 0.5)@2001-01-04]'; -- [0@2001-01-02, 0@2001-01-03]
Return the minimum spatial distance between two sets of temporal circular buffers, ignoring time
minDistance(tcbuffer[],tcbuffer[]) → float
The distance is measured between the traversed areas with time discarded, equal to ST_Distance of the traversed area of each argument, and the result is the minimum over every pair drawn from the two sets. Two values whose discs sweep the same region at different times are therefore at distance zero. The time-synchronous quantity, which compares two arguments only at the instants they share, is |=|. A single pair is the one-element case.
SELECT minDistance(ARRAY[tcbuffer '[Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(2 0),1)@2001-01-02]'], ARRAY[tcbuffer '[Cbuffer(Point(0 5),0.5)@2001-01-03, Cbuffer(Point(2 5),0.5)@2001-01-04]']); -- 3.5