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 centroid (antenna) at t lies in that region.
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 temporalTime(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-02, 2001-01-04]}
SELECT temporalTime(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-01, 2001-01-02), (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 temporalTime(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-02, 2001-01-04]}
SELECT temporalTime(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 T([2001-01-02, 2001-01-04])'));
-- {[2001-01-02, 2001-01-04]}
If the STBox has only a temporal component the call collapses to the standard atTime; if it has only a spatial component the temporal domain is preserved.
Restrict a trgeometry to (the complement of) an elevation span
atElevation(trgeometry,floatspan) → trgeometry minusElevation(trgeometry,floatspan) → trgeometry
The elevation is that of the position of the pose, not that of the body: a body extends above and below its position, and the span is tested against the position alone. The reference geometry is carried over to the result. The temporal rigid geometry must have Z dimension.
SELECT asText(atElevation(trgeometry 'Polygon Z((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0));
[Pose(Point(0 0 0),1,0,0,0)@2001-01-01, Pose(Point(0 0 4),1,0,0,0)@2001-01-05]',
floatspan '[1, 2]'));
/* POLYGON Z ((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0)); {[Pose(POINT Z
(0 0 1),1,0,0,0)@2001-01-02,
Pose(POINT Z (0 0 2),1,0,0,0)@2001-01-03]} */
SELECT getTime(minusElevation(trgeometry 'Polygon Z((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0));
[Pose(Point(0 0 0),1,0,0,0)@2001-01-01, Pose(Point(0 0 4),1,0,0,0)@2001-01-05]',
floatspan '[1, 2]'));
-- {[2001-01-01, 2001-01-02), (2001-01-03, 2001-01-05]}