The topological and distance relationships described in the section called “Spatial Relationships” such as eIntersects
, aDwithin
, or tContains
only consider the location of the geometries, not their orientation. To be able to apply these spatial relationships to the temporal poses, they must be transformed to temporal geometry points. This can be easily performed using the functions geometry
and tgeompoint
or using an explicit casting ::
as shown in the examples below.
SELECT eContains(geometry 'Polygon((0 0,0 50,50 50,50 0,0 0))', tgeompoint(tpose '[Pose(Point(1 1),0.1)@2001-01-01, Pose(Point(1 1),0.3)@2001-01-03)')); -- true SELECT eDisjoint(geometry(pose 'Pose(Point(2 2), 0.0)'), tgeompoint(tpose '[Pose(Point(1 1),0.1)@2001-01-01, Pose(Point(1 1),0.3)@2001-01-03)')); -- true SELECT eIntersects( tpose '[Pose(Point(1 1),0.1)@2001-01-01, Pose(Point(1 1),0.3)@2001-01-03)'::tgeompoint, tpose '[Pose(Point(2 2),0.0)@2001-01-01, Pose(Point(2 2),1)@2001-01-03)'::tgeompoint); -- false
SELECT tContains(geometry 'Polygon((0 0,0 50,50 50,50 0,0 0))', tgeompoint(tpose '[Pose(Point(1 1),0.1)@2001-01-01, Pose(Point(1 1),0.3)@2001-01-03)')); -- {[t@2001-01-01 00:00:00+01, t@2001-01-03 00:00:00+01)} SELECT tDisjoint(geometry(pose 'Pose(Point(2 2), 0.0)'), tgeompoint(tpose '[Pose(Point(1 1),0.1)@2001-01-01, Pose(Point(1 1),0.3)@2001-01-03)')); -- [t@2001-01-01, t@2001-01-03) SELECT tDwithin( tpose '[Pose(Point(1 1),0.3)@2001-01-01,Pose(Point(1 1),0.5)@2001-01-03)'::tgeompoint, tpose '[Pose(Point(1 1),0.5)@2001-01-01,Pose(Point(3 3),0.3)@2001-01-03)'::tgeompoint,1); /* {[t@2001-01-01 00:00:00+01, t@2001-01-01 16:58:14.025894+01], (f@2001-01-01 16:58:14.025894+01, f@2001-01-03 00:00:00+01)} */