Return or set the spatial reference identifier
SRID(tcbuffer) → integer setSRID(tcbuffer,integer) → tcbuffer
The SRID is set as setSRID sets it on a geometry, an SRID beyond the reserved range being folded into it, and the values and the bounding box take that one SRID. The invalid SRID is refused, and so is the unknown SRID 0, which a negative SRID is read as.
SELECT SRID(tcbuffer 'SRID=5676; [Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02)'); -- 5676 SELECT asEWKT(setSRID(tcbuffer '[Cbuffer(Point(0 0),1)@2001-01-01, Cbuffer(Point(1 1),2)@2001-01-02)', 5676)); -- SRID=5676;[Cbuffer(POINT(0 0),1)@2001-01-01, Cbuffer(POINT(1 1),2)@2001-01-02)
Transform to a spatial reference identifier
transform(tcbuffer,integer) → tcbuffer transformPipeline(tcbuffer,pipeline text,srid integer, is_forward boolean=true) → tcbuffer
The transform function specifies the transformation with a target SRID. An error is raised when the input temporal circular buffer has an unknown SRID (represented by 0). The transformPipeline function specifies the transformation with a defined coordinate transformation pipeline represented with the following string format: urn:ogc:def:coordinateOperation:AUTHORITY::CODE. The SRID of the input temporal circular buffer is ignored, and the SRID of the output temporal circular buffer will be set to zero unless a value is provided via the optional srid parameter. As stated by the last parameter, the pipeline is executed by default in a forward direction; by setting the parameter to false, the pipeline is executed in the inverse direction. A temporal circular buffer is planar, as a circular buffer is, so a geographic target raises an error.
SELECT asEWKT(transform(tcbuffer 'SRID=4326;Cbuffer(Point(4.35 50.85),1)@2001-01-01', 3812)); -- SRID=3812;Cbuffer(POINT(648679.0180353033 671067.0556381135),1)@2001-01-01
SELECT asEWKT(transformPipeline(tcbuffer 'SRID=4326;{Cbuffer(Point(4.3525 50.846667),1)@2001-01-01,
Cbuffer(Point(-0.1275 51.507222),2)@2001-01-02}',
'urn:ogc:def:coordinateOperation:EPSG::16031', 32631), 3);
/* SRID=32631;{Cbuffer(POINT(595215.059 5633645.441),1)@2001-01-01,
Cbuffer(POINT(282970.182 5710870.493),2)@2001-01-02} */
SELECT transform(tcbuffer 'SRID=25832;Cbuffer(Point(651337 6058377),10)@2001-01-01', 4326);
-- ERROR: A circular buffer is planar and cannot be transformed to a geographic reference system
Return the area traversed by the temporal circular buffer
traversedArea(tcbuffer,unary_union boolean=false) → geometry
SELECT ST_AsText(traversedArea(tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-01, Cbuffer(Point(1 1), 0.5)@2001-01-02]')); -- CURVEPOLYGON(CIRCULARSTRING(0.5 1,1.5 1,0.5 1)) SELECT ST_AsText(traversedArea(tcbuffer '[Cbuffer(Point(1 1), 0.5)@2001-01-01, Cbuffer(Point(3 1), 0.5)@2001-01-02, Cbuffer(Point(1 1), 0.5)@2001-01-03]', true)); /* CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(3 0.5,3.5 1,3 1.5),(3 1.5,1 1.5), CIRCULARSTRING(1 1.5,0.646446609406726 1.353553390593274,0.5 1), CIRCULARSTRING(0.5 1,0.646446609406726 0.646446609406726,1 0.5),(1 0.5,3 0.5))) */ SELECT ST_AsText(traversedArea(tcbuffer '[Cbuffer(Point(1 1), 0)@2001-01-01, Cbuffer(Point(3 1), 0)@2001-01-02, Cbuffer(Point(4 1), 0.5)@2001-01-03]', true)); /* GEOMETRYCOLLECTION(CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(3.75 0.566987298107781, 4.5 1,3.75 1.433012701892219),(3.75 1.433012701892219,3 1,3.75 0.566987298107781))), LINESTRING(1 1,3 1)) */
The argument is false unless it is given, and the function then answers the pieces the buffer sweeps, each a disc or the region a disc sweeps between two consecutive instants, gathered into one geometry. With unary_union = true they are dissolved into the region they cover, computed exactly: every meeting of the circles and of the segments joining them is decided on the input coordinates, no arc is replaced by segments, and only the vertices of the result are rounded, each once. The result keeps its arcs, as a CURVEPOLYGON or a MULTISURFACE. Where the buffer keeps a zero radius, the line or the point it draws that no disc covers is returned beside the surfaces in a GEOMETRYCOLLECTION. Where the computation cannot decide a meeting or an order of the boundaries, the function raises an error rather than answer an approximation.
Return the space-time volume of the temporal circular buffer, the integral of the area of its disc over the time
spaceTimeVolume(tcbuffer) → float
The radius of a segment in linear interpolation varies linearly between its instants, and the volume of the segment is computed exactly in closed form; the motion of the center changes no area. The time is read in microseconds, as integral reads it, so the result is in the square units of the buffer times microseconds. A buffer of instants has a volume of zero.
SELECT round((spaceTimeVolume(tcbuffer '[Cbuffer(Point(1 1),1)@2001-01-01, Cbuffer(Point(5 5),2)@2001-01-02]') / (24 * 3600 * 1e6 * pi()))::numeric, 6); -- 2.333333 SELECT round((spaceTimeVolume(tcbuffer 'Interp=Step;[Cbuffer(Point(1 1),1)@2001-01-01, Cbuffer(Point(5 5),2)@2001-01-02]') / (24 * 3600 * 1e6 * pi()))::numeric, 6); -- 1.000000
Return the temporal geometric point given by the centers of a temporal circular buffer
centroid(tcbuffer) → tgeompoint
SELECT asText(centroid(tcbuffer '[Cbuffer(Point(1 1), 0.5)@2001-01-01, Cbuffer(Point(3 3), 0.5)@2001-01-03]')); -- [POINT(1 1)@2001-01-01, POINT(3 3)@2001-01-03]
Return the convex hull of the area traversed by the temporal circular buffer
convexHull(tcbuffer) → geometry
The convex hull is computed on the exact traversed area, arcs included: an arc reaches past the points that define it, so it contributes to the hull the piece of its circle that no other feature of the area reaches past. The result is therefore a curved CURVEPOLYGON bounded by a COMPOUNDCURVE of circular arcs and straight segments, as exact as the region returned by traversedArea. The hull is linear only when the buffer keeps a zero radius, since the traversed area then carries no arc.
SELECT ST_AsText(convexHull(tcbuffer '[Cbuffer(Point(1 1), 0.5)@2001-01-01, Cbuffer(Point(1 3), 0.5)@2001-01-02]')); /* CURVEPOLYGON(COMPOUNDCURVE((1.5 3,1.5 1),CIRCULARSTRING(1.5 1,1 0.5,0.5 1), (0.5 1,0.5 3),CIRCULARSTRING(0.5 3,1 3.5,1.5 3))) */ SELECT ST_AsText(convexHull(tcbuffer '[Cbuffer(Point(1 1), 0)@2001-01-01, Cbuffer(Point(1 3), 0)@2001-01-02, Cbuffer(Point(3 3), 0)@2001-01-03]')); -- POLYGON((1 1,1 3,3 3,1 1))