Temporal contains
tContains(geometry,tgeom) → tbool
SELECT tContains(geometry 'Linestring(1 1,3 3)',
tgeompoint '[Point(4 2)@2001-01-01, Point(2 4)@2001-01-02]');
-- {[f@2001-01-01, f@2001-01-02]}
SELECT tContains(geometry 'Linestring(1 1,3 3,1 1)',
tgeompoint '[Point(4 2)@2001-01-01, Point(2 4)@2001-01-03]');
-- {[f@2001-01-01, t@2001-01-02], (f@2001-01-02, f@2001-01-03]}
SELECT tContains(geometry 'Polygon((1 1,1 3,3 3,3 1,1 1))',
tgeompoint '[Point(0 1)@2001-01-01, Point(4 1)@2001-01-02]');
-- {[f@2001-01-01, f@2001-01-02]}
SELECT tContains(geometry 'Polygon((1 1,1 3,3 3,3 1,1 1))',
tgeompoint '[Point(1 4)@2001-01-01, Point(4 1)@2001-01-04]');
-- {[f@2001-01-01, f@2001-01-02], (t@2001-01-02, f@2001-01-03, f@2001-01-04]}
Temporal disjoint
tDisjoint({geo,tgeo},{geo,tgeo}) → tbool
The function is the negation of tIntersects. Geographies are supported as stated in the section called “Planar and Geodetic Computations”.
SELECT tDisjoint(geometry 'Polygon((1 1,1 2,2 2,2 1,1 1))',
tgeompoint '[Point(0 0)@2001-01-01, Point(3 3)@2001-01-04)');
-- {[t@2001-01-01, f@2001-01-02, f@2001-01-03], (t@2001-01-03, t@2001-01-04]}
SELECT tDisjoint(tgeompoint '[Point(0 3)@2001-01-01, Point(3 0)@2001-01-05)',
tgeompoint '[Point(0 0)@2001-01-01, Point(3 3)@2001-01-05)');
-- {[t@2001-01-01, f@2001-01-03], (t@2001-01-03, t@2001-01-05)}
Temporal distance within
tDwithin({geo,tgeo},{geo,tgeo},float) → tbool
tDwithin({geography,tgeog},{geography,tgeog},float,spheroid boolean=true) → tbool
Geographies are supported as stated in the section called “Planar and Geodetic Computations”: for a temporal geography point with linear interpolation, the other argument is a geography point or a temporal geography point. The distance is measured on the WGS 84 spheroid by default. If the last argument is false, it is measured on the sphere. A segment of a temporal geography point moves along a great circle, and the result changes its value at every instant at which the geodetic distance crosses the given distance, which a segment may cross several times.
SELECT tDwithin(geometry 'Point(1 1)',
tgeompoint '[Point(0 0)@2001-01-01, Point(2 2)@2001-01-03)', sqrt(2));
-- {[t@2001-01-01, t@2001-01-03)}
SELECT tDwithin(tgeompoint '[Point(1 0)@2001-01-01, Point(1 4)@2001-01-05]',
tgeompoint 'Interp=Step;[Point(1 2)@2001-01-01, Point(1 3)@2001-01-05]', 1);
-- {[f@2001-01-01, t@2001-01-02, t@2001-01-04], (f@2001-01-04, t@2001-01-05]}
SELECT tDwithin(geography 'Point(1 0.1)',
tgeogpoint '[Point(0 0)@2001-01-01, Point(2 0)@2001-01-03]', 15000);
/* {[f@2001-01-01, t@2001-01-01 21:48:53.195554, t@2001-01-02 02:11:06.804445],
(f@2001-01-02 02:11:06.804445, f@2001-01-03]} */
SELECT tDwithin(tgeogpoint '[Point(0 0)@2001-01-01, Point(2 0)@2001-01-03]',
tgeogpoint '[Point(1 1)@2001-01-01, Point(1 -1)@2001-01-03]', 20000, false);
/* {[f@2001-01-01, t@2001-01-01 20:56:51.37512, t@2001-01-02 03:03:08.624879],
(f@2001-01-02 03:03:08.624879, f@2001-01-03]} */
SELECT tDwithin(tgeography '[Polygon((0 0,2 0,2 2,0 2,0 0))@2001-01-01,
Point(3 3)@2001-01-02, Polygon((2 2,4 2,4 4,2 4,2 2))@2001-01-03]',
geography 'Point(1 1)', 200000);
-- [t@2001-01-01, f@2001-01-02, t@2001-01-03]
Temporal intersects
tIntersects({geo,tgeo},{geo,tgeo}) → tbool
Two temporal points intersect at the instants at which they are equal. Two temporal geometries or geographies, whose values are constant between their instants, intersect at the instants at which their values intersect, and two geographies intersect where their distance is zero. Geographies are supported as stated in the section called “Planar and Geodetic Computations”.
SELECT tIntersects(geometry 'MultiPoint(1 1,2 2)',
tgeompoint '[Point(0 0)@2001-01-01, Point(3 3)@2001-01-04)');
/* {[f@2001-01-01, t@2001-01-02], (f@2001-01-02, t@2001-01-03],
(f@2001-01-03, f@2001-01-04]} */
SELECT tIntersects(tgeompoint '[Point(0 3)@2001-01-01, Point(3 0)@2001-01-05)',
tgeompoint '[Point(0 0)@2001-01-01, Point(3 3)@2001-01-05)');
-- {[f@2001-01-01, t@2001-01-03], (f@2001-01-03, f@2001-01-05)}
SELECT tIntersects(tgeometry '[Polygon((0 0,2 0,2 2,0 2,0 0))@2001-01-01,
Point(3 3)@2001-01-02]', tgeometry '[Point(1 1)@2001-01-01, Point(1 1)@2001-01-02]');
-- [t@2001-01-01, f@2001-01-02]
SELECT tIntersects(tgeography '[Polygon((0 0,2 0,2 2,0 2,0 0))@2001-01-01,
Point(3 3)@2001-01-02, Polygon((2 2,4 2,4 4,2 4,2 2))@2001-01-03]',
geography 'Point(1 1)');
-- [t@2001-01-01, f@2001-01-02, f@2001-01-03]
Temporal touches
tTouches({geometry,tgeom},{geometry,tgeom}) → tbool
SELECT tTouches(geometry 'Polygon((1 0,1 2,2 2,2 0,1 0))',
tgeompoint '[Point(0 0)@2001-01-01, Point(3 0)@2001-01-04)');
-- {[f@2001-01-01, t@2001-01-02, t@2001-01-03], (f@2001-01-03, f@2001-01-04]}