The three aggregate functions for temporal network points are illustrated next.
Temporal count
tcount(tnpoint): {tint_instset,tint_seqset}
WITH Temp(temp) AS ( SELECT tnpoint '[NPoint(1, 0.1)@2012-01-01, NPoint(1, 0.3)@2012-01-03)' UNION SELECT tnpoint '[NPoint(1, 0.2)@2012-01-02, NPoint(1, 0.4)@2012-01-04)' UNION SELECT tnpoint '[NPoint(1, 0.3)@2012-01-03, NPoint(1, 0.5)@2012-01-05)' ) SELECT tcount(Temp) FROM Temp -- {[1@2012-01-01, 2@2012-01-02, 1@2012-01-04, 1@2012-01-05)}
Window count
wcount(tnpoint): {tint_instset,tint_seqset}
WITH Temp(temp) AS ( SELECT tnpoint '[NPoint(1, 0.1)@2012-01-01, NPoint(1, 0.3)@2012-01-03)' UNION SELECT tnpoint '[NPoint(1, 0.2)@2012-01-02, NPoint(1, 0.4)@2012-01-04)' UNION SELECT tnpoint '[NPoint(1, 0.3)@2012-01-03, NPoint(1, 0.5)@2012-01-05)' ) SELECT wcount(Temp, '1 day') FROM Temp -- {[1@2012-01-01, 2@2012-01-02, 3@2012-01-03, 2@2012-01-04, 1@2012-01-05, 1@2012-01-06)}
Temporal centroid
tcentroid(tnpoint): tgeompoint
WITH Temp(temp) AS ( SELECT tnpoint '[NPoint(1, 0.1)@2012-01-01, NPoint(1, 0.3)@2012-01-03)' UNION SELECT tnpoint '[NPoint(1, 0.2)@2012-01-01, NPoint(1, 0.4)@2012-01-03)' UNION SELECT tnpoint '[NPoint(1, 0.3)@2012-01-01, NPoint(1, 0.5)@2012-01-03)' ) SELECT astext(tcentroid(Temp)) FROM Temp -- {[POINT(72.451531682218 76.5231414472853)@2012-01-01, POINT(55.7001249027598 72.9552602410653)@2012-01-03)}