The standard sequence-modifying functions apply: round, setInterp, shiftTime, scaleTime, shiftScaleTime, deleteTimestamp, etc.
Round all numeric components to a given number of decimal places
round(trgeometry,integer) → trgeometry
SELECT asText(round( trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0)); Pose(Point(1.123456789 1.123456789), 0.123456)@2001-01-01', 3)); -- POLYGON((0 0,1 0,1 1,0 1,0 0));Pose(POINT(1.123 1.123),0.123)@...
Convert between linear and step interpolations
setInterp(trgeometry,text) → trgeometry
SELECT asText(setInterp(trgeometry 'Interp=Step;Polygon((0 0,1 0,1 1,0 1,0 0));
[Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(10 0), 0.0)@2001-01-02]', 'linear'));
-- POLYGON((0 0,1 0,1 1,0 1,0 0));
-- {[Pose(POINT(0 0),0)@2001-01-01, Pose(POINT(0 0),0)@2001-01-02),
-- [Pose(POINT(10 0),0)@2001-01-02]}
Shift, scale, or both shift and scale the time domain of a trgeometry
shiftTime(trgeometry,interval) → trgeometry scaleTime(trgeometry,interval) → trgeometry shiftScaleTime(trgeometry,interval,interval) → trgeometry
SELECT asText(shiftTime(trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0)); [Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(10 0), 0.0)@2001-01-02]', interval '1 day')); -- POLYGON((0 0,1 0,1 1,0 1,0 0)); -- [Pose(POINT(0 0),0)@2001-01-02, Pose(POINT(10 0),0)@2001-01-03] SELECT asText(scaleTime(trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0)); [Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(10 0), 0.0)@2001-01-02]', interval '2 days')); -- POLYGON((0 0,1 0,1 1,0 1,0 0)); -- [Pose(POINT(0 0),0)@2001-01-01, Pose(POINT(10 0),0)@2001-01-03] SELECT asText(shiftScaleTime(trgeometry 'Polygon((0 0,1 0,1 1,0 1,0 0)); [Pose(Point(0 0), 0.0)@2001-01-01, Pose(Point(10 0), 0.0)@2001-01-02]', interval '1 day', interval '2 days')); -- POLYGON((0 0,1 0,1 1,0 1,0 0)); -- [Pose(POINT(0 0),0)@2001-01-02, Pose(POINT(10 0),0)@2001-01-04]
Transform a nonlinear trgeometry into a set of rows, one per distinct pose, each one is a pair composed of the reference geometry with the pose applied and the period set during which the trgeometry takes that pose
unnest(trgeometry) → {(value,time)}
SELECT ST_AsText((un).value), (un).time
FROM (SELECT unnest(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-02,
Pose(Point(0 0), 0.0)@2001-01-03}') AS un) t;
-- POLYGON((0 0,1 0,1 1,0 1,0 0)) | {[2001-01-01, 2001-01-01], [2001-01-03, 2001-01-03]}
-- POLYGON((4 0,5 0,5 1,4 1,4 0)) | {[2001-01-02, 2001-01-02]}
SELECT ST_AsText(ST_SnapToGrid((un).value, 0.000001)), (un).time
FROM (SELECT unnest(merge(
trgeometry(geometry 'Polygon((0 0,1 0,1 1,0 1,0 0))',
pose(geometry 'Point(0 0)', 0), timestamptz '2001-01-01'),
trgeometry(geometry 'Polygon((0 0,1 0,1 1,0 1,0 0))',
pose(geometry 'Point(3 2)', pi() / 2), timestamptz '2001-01-02'))) AS un) t;
-- POLYGON((0 0,1 0,1 1,0 1,0 0)) | {[2001-01-01, 2001-01-01]}
-- POLYGON((3 2,3 3,2 3,2 2,3 2)) | {[2001-01-02, 2001-01-02]}
The pose is applied to the reference geometry in every row of the result: the value of a row is the reference geometry rotated by the orientation of the pose and then translated to its position, the geometry that startValue and valueAtTimestamp return at that pose. In the second example the pose rotates the square by 90° and moves it to (3, 2). A reference geometry that a rotation maps onto itself yields rows with equal geometries, one per pose.