Las tres funciones agregadas para búferes circulares temporales se ilustran a continuación.
Conteo temporal
tCount(tcbuffer) → {tintSeq,tintSeqSet}
WITH Temp(temp) AS (
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.1)@2001-01-01,
Cbuffer(Point(1 1), 0.3)@2001-01-03)' UNION
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.2)@2001-01-02,
Cbuffer(Point(1 1), 0.4)@2001-01-04)' UNION
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-03,
Cbuffer(Point(1 1), 0.5)@2001-01-05)' )
SELECT tCount(Temp)
FROM Temp;
-- {[1@2001-01-01, 2@2001-01-02, 1@2001-01-04, 1@2001-01-05)}
Conteo de ventana
wCount(tcbuffer) → {tintSeq,tintSeqSet}
WITH Temp(temp) AS (
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.1)@2001-01-01,
Cbuffer(Point(1 1), 0.3)@2001-01-03)' UNION
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.2)@2001-01-02,
Cbuffer(Point(1 1), 0.4)@2001-01-04)' UNION
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.3)@2001-01-03,
Cbuffer(Point(1 1), 0.5)@2001-01-05)' )
SELECT wCount(Temp, '1 day')
FROM Temp;
/* {[1@2001-01-01, 2@2001-01-02, 3@2001-01-03, 2@2001-01-04, 1@2001-01-05,
1@2001-01-06)} */
Agregar los centros de un conjunto de búferes circulares temporales en su centroide temporal, convirtiendo a tgeompoint
tCentroid(tcbuffer::tgeompoint) → tgeompoint
La agregación pertenece al tipo tgeompoint: la trayectoria del centro de un búfer circular es un punto temporal, de modo que la conversión alcanza la agregación en lugar de que el tipo búfer lleve su propia copia.
WITH Temp(temp) AS (
SELECT tcbuffer '[Cbuffer(Point(1 1), 0.1)@2001-01-01,
Cbuffer(Point(1 1), 0.3)@2001-01-03)' UNION
SELECT tcbuffer '[Cbuffer(Point(3 3), 0.2)@2001-01-01,
Cbuffer(Point(3 3), 0.4)@2001-01-03)' )
SELECT asText(tCentroid(temp::tgeompoint)) FROM Temp;
-- {[POINT(2 2)@2001-01-01, POINT(2 2)@2001-01-03)}