Las tres funciones de agregación para poses temporales se ilustran a continuación.
Conteo temporal
tCount({tpose,tposechain}) → {tintSeq,tintSeqSet}
WITH Temp(temp) AS (
SELECT tpose '[Pose(Point(1 1), 0.1)@2001-01-01,
Pose(Point(1 1), 0.3)@2001-01-03)' UNION
SELECT tpose '[Pose(Point(1 1), 0.2)@2001-01-02,
Pose(Point(1 1), 0.4)@2001-01-04)' UNION
SELECT tpose '[Pose(Point(1 1), 0.3)@2001-01-03, Pose(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({tpose,tposechain},interval) → {tintSeq,tintSeqSet}
WITH Temp(temp) AS (
SELECT tpose '[Pose(Point(1 1), 0.1)@2001-01-01,
Pose(Point(1 1), 0.3)@2001-01-03)' UNION
SELECT tpose '[Pose(Point(1 1), 0.2)@2001-01-02,
Pose(Point(1 1), 0.4)@2001-01-04)' UNION
SELECT tpose '[Pose(Point(1 1), 0.3)@2001-01-03, Pose(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)} */
Extensión del cuadro delimitador
extent({tpose,tposechain}) → stbox
SELECT extent(temp) FROM (VALUES (NULL::tposechain),
(tposechain 'PoseChain(Pose(Point(1 1), 0.1))@2001-01-01'),
(tposechain '{PoseChain(Pose(Point(2 2), 0.2))@2001-01-01,
PoseChain(Pose(Point(3 3), 0.3))@2001-01-02}')) t(temp);
-- STBOX XT(((1,1),(3,3)),[2001-01-01, 2001-01-02])
Agrega los instantes agregados en una secuencia
appendInstantAgg({tpose,tposechain}) → {tpose,tposechain}
El nombre appendInstant denota la misma agregación
SELECT asText(appendInstantAgg(inst)) FROM (VALUES (tposechain 'PoseChain(Pose(Point(1 1), 0.1))@2001-01-01'), (tposechain 'PoseChain(Pose(Point(2 2), 0.2))@2001-01-02')) t(inst); /* [PoseChain(Pose(POINT(1 1),0.1))@2001-01-01, PoseChain(Pose(POINT(2 2),0.2))@2001-01-02] */
Agrega las secuencias agregadas en un conjunto de secuencias
appendSequenceAgg({tpose,tposechain}) → {tpose,tposechain}
El nombre appendSequence denota la misma agregación
SELECT asText(appendSequenceAgg(seq)) FROM (VALUES
(tposechain '[PoseChain(Pose(Point(1 1), 0.1))@2001-01-01]'),
(tposechain '[PoseChain(Pose(Point(2 2), 0.2))@2001-01-02]')) t(seq);
/* {[PoseChain(Pose(POINT(1 1),0.1))@2001-01-01],
[PoseChain(Pose(POINT(2 2),0.2))@2001-01-02]} */