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.
Return a temporal value translated by given offsets
translate(trgeometry,deltax float,deltay float,deltaz float=0) → trgeometry
A vertical offset takes a two-dimensional value out of its plane, so the result is three-dimensional.
The motion moves the pose of every instant and keeps the reference geometry. A motion that takes a two-dimensional value out of its plane takes the reference geometry with it, in the plane z = 0.
The motion is a planar map, so a geodetic value raises an error.
SELECT asText(translate(trgeometry 'Polygon((0 0,2 0,2 1,0 1,0 0)); [Pose(Point(1 1),0.3)@2001-01-01, Pose(Point(3 2),1.1)@2001-01-02]', 1, 2), 6); /* POLYGON((0 0,2 0,2 1,0 1,0 0));[Pose(POINT(2 3),0.3)@2001-01-01, Pose(POINT(4 4),1.1)@2001-01-02] */
Return a temporal value rotated counter-clockwise about the origin or about a point
rotate(trgeometry,angle float) → trgeometry rotate(trgeometry,angle float,x0 float,y0 float) → trgeometry
The motion moves the pose of every instant and keeps the reference geometry. A motion that takes a two-dimensional value out of its plane takes the reference geometry with it, in the plane z = 0.
The motion is a planar map, so a geodetic value raises an error.
SELECT asText(rotate(trgeometry 'Polygon((0 0,2 0,2 1,0 1,0 0)); [Pose(Point(1 1),0.3)@2001-01-01, Pose(Point(3 2),1.1)@2001-01-02]', 0.7, 1, 1), 6); /* POLYGON((0 0,2 0,2 1,0 1,0 0));[Pose(POINT(1 1),1)@2001-01-01, Pose(POINT(1.885467 3.053278),1.8)@2001-01-02] */
Return a temporal value rotated counter-clockwise about the x axis
rotateX(trgeometry,angle float) → trgeometry
The rotation takes a two-dimensional value out of its plane, so the result is three-dimensional: each position gains the height the rotation gives it, and each orientation is the rotation composed with the angle about the vertical that the value states.
The motion moves the pose of every instant and keeps the reference geometry. A motion that takes a two-dimensional value out of its plane takes the reference geometry with it, in the plane z = 0.
The motion is a planar map, so a geodetic value raises an error.
SELECT asText(rotateX(trgeometry 'Polygon((0 0,2 0,2 1,0 1,0 0)); [Pose(Point(1 1),0.3)@2001-01-01, Pose(Point(3 2),1.1)@2001-01-02]', 0.7), 6); /* POLYGON Z ((0 0 0,2 0 0,2 1 0,0 1 0,0 0 0)); [Pose(POINT Z (1 0.764842 0.644218),0.928825,0.339047,-0.051242,0.140378)@2001-01-01, Pose(POINT Z (3 1.529684 1.288435),0.800838,0.292329,-0.179228,0.490998)@2001-01-02] */
Return a temporal value rotated counter-clockwise about the y axis
rotateY(trgeometry,angle float) → trgeometry
The rotation takes a two-dimensional value out of its plane, so the result is three-dimensional: each position gains the height the rotation gives it, and each orientation is the rotation composed with the angle about the vertical that the value states.
The motion moves the pose of every instant and keeps the reference geometry. A motion that takes a two-dimensional value out of its plane takes the reference geometry with it, in the plane z = 0.
The motion is a planar map, so a geodetic value raises an error.
Return a temporal value rotated counter-clockwise about the z axis
rotateZ(trgeometry,angle float) → trgeometry
The motion moves the pose of every instant and keeps the reference geometry. A motion that takes a two-dimensional value out of its plane takes the reference geometry with it, in the plane z = 0.
The motion is a planar map, so a geodetic value raises an error.