The atGeometry, minusGeometry, atStbox, and minusStbox functions restrict a trgeometry to (the complement of) a geometry or a spatiotemporal box. The semantic mirrors tpose: a temporal rigid geometry is "in" a region at time t iff its body, the reference geometry placed by the pose at t, meets that region. atGeometry and minusGeometry are not yet supported for a value in three dimensions, nor for a geometry with Z or with holes, and atStbox and minusStbox do not yet read the Z dimension of a box.
Restrict to (the complement of) a pose or a set of poses
atValue(trgeometry,pose) → trgeometry minusValue(trgeometry,pose) → trgeometry atValues(trgeometry,poseset) → trgeometry minusValues(trgeometry,poseset) → trgeometry
SELECT asText(atValue(trgeometry 'Polygon((1 1,2 2,3 1,1 1));
[Pose(Point(1 1), 0.2)@2001-01-01, Pose(Point(1 1), 0.4)@2001-01-02,
Pose(Point(1 1), 0.5)@2001-01-03]', pose 'Pose(Point(1 1), 0.5)'));
-- POLYGON((1 1,2 2,3 1,1 1));{[Pose(POINT(1 1),0.5)@2001-01-03]}
SELECT asText(minusValue(trgeometry 'Polygon((1 1,2 2,3 1,1 1));
{Pose(Point(1 1), 0.3)@2001-01-01, Pose(Point(1 1), 0.5)@2001-01-02,
Pose(Point(1 1), 0.5)@2001-01-03}', pose 'Pose(Point(1 1), 0.5)'));
-- POLYGON((1 1,2 2,3 1,1 1));{Pose(POINT(1 1),0.3)@2001-01-01}
The restricting value is a pose, the base value a temporal rigid geometry interpolates. The reference geometry is carried through unchanged, so the result describes the same body.
Restrict a trgeometry to (the complement of) a geometry
atGeometry(trgeometry,geometry) → trgeometry minusGeometry(trgeometry,geometry) → trgeometry
SELECT getTime(atGeometry( trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0));
[Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(4 0), 0.0)@2001-01-05]',
geometry 'Polygon((1 -1,3 -1,3 1,1 1,1 -1))'));
-- {[2001-01-01, 2001-01-04]}
SELECT getTime(minusGeometry( trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0));
[Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(4 0), 0.0)@2001-01-05]',
geometry 'Polygon((1 -1,3 -1,3 1,1 1,1 -1))'));
-- {(2001-01-04, 2001-01-05]}
Restriction against an empty geometry returns NULL for atGeometry and the original input for minusGeometry.
Restrict a trgeometry to (the complement of) a spatiotemporal box
atStbox(trgeometry,stbox[,border_inc boolean=true]) → trgeometry minusStbox(trgeometry,stbox[,border_inc boolean=true]) → trgeometry
SELECT getTime(atStbox( trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0));
[Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(4 0), 0.0)@2001-01-05]',
stbox 'STBOX X((1, -1), (3, 1))'));
-- {[2001-01-01, 2001-01-04]}
A box with only a temporal component is not yet supported, and atTime answers that question; if the box has only a spatial component the temporal domain is preserved.