The three aggregate functions for temporal poses are illustrated next.
Temporal count
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)}
Window count
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)} */
Bounding box extent
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])
Append the aggregated instants into a sequence
appendInstantAgg({tpose,tposechain}) → {tpose,tposechain}
The name appendInstant denotes the same aggregate
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] */
Append the aggregated sequences into a sequence set
appendSequenceAgg({tpose,tposechain}) → {tpose,tposechain}
The name appendSequence denotes the same aggregate
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]} */