Bounding-box aggregate over a column of tpcpoint, tpcpatch, or tpcbox values. Returns the smallest tpcbox containing every input. Aggregating across distinct pcids raises an error, the bbox would be uninterpretable since dimensions are pcid-relative.
extent(tpcpoint) → tpcbox
extent(tpcpatch) → tpcbox
extent(tpcbox) → tpcbox
SELECT extent(v) FROM (VALUES (tpcpoint(pcpoint(1, 1, 1, 1), '2001-01-01'::timestamptz)), (tpcpoint(pcpoint(1, 2, 2, 2), '2001-01-02'::timestamptz))) t(v); -- TPCBOX(ZT(((1,1,1),(2,2,2)),[2001-01-01, 2001-01-02]), 1)
Temporal count and window count of overlapping rows at each timestamp. Result is a tint. All input rows must share the same temporal subtype (instant / sequence / sequence set).
tCount(tpcpoint) → tint, tCount(tpcpatch) → tint
wCount(tpcpoint,interval) → tint, wCount(tpcpatch,interval) → tint
SELECT tCount(v) FROM (VALUES
(tpcpoint(pcpoint(1, 1, 1, 1), '2001-01-01'::timestamptz)),
(tpcpoint(pcpoint(1, 2, 2, 2), '2001-01-02'::timestamptz))) t(v);
-- {1@2001-01-01, 1@2001-01-02}
SELECT wCount(v, interval '1 day') FROM (VALUES
(tpcpoint(pcpoint(1, 1, 1, 1), '2001-01-01'::timestamptz)),
(tpcpoint(pcpoint(1, 2, 2, 2), '2001-01-02'::timestamptz))) t(v);
-- {[1@2001-01-01, 2@2001-01-02], (1@2001-01-02, 1@2001-01-03]}
Per-instant pcpatch point count, summed across rows. Distinct from tCount(tpcpatch), which counts the number of patches (always 1 per instant). tnpoints reads as "how many points were in the cloud at time t", the natural primitive for ingest-QC and density-over-time dashboards.
tnpoints(tpcpatch) → tint
SELECT tnpoints(v) FROM (VALUES
(tpcpatch(pcpatch(1, pcpoint(1, 1, 1, 1), pcpoint(1, 2, 2, 2)), '2001-01-01'::timestamptz)),
(tpcpatch(pcpatch(1, pcpoint(1, 3, 3, 3), pcpoint(1, 4, 4, 4)), '2001-01-02'::timestamptz))) t(v);
-- {2@2001-01-01, 2@2001-01-02}
Per-instant point density (numPoints / xy-bbox-area) summed across rows. Each pcpatch carries the inline PCBOUNDS (xmin / xmax / ymin / ymax) so the bbox-area term is read directly, no recomputation. A 1-point or co-linear patch yields +Infinity for that instant; filter with isfinite() in downstream queries if needed.
tdensity(tpcpatch) → tfloat
-- Each patch holds 2 points over a 1x1 xy-bbox.
SELECT tdensity(v) FROM (VALUES
(tpcpatch(pcpatch(1, pcpoint(1, 1, 1, 1), pcpoint(1, 2, 2, 2)), '2001-01-01'::timestamptz)),
(tpcpatch(pcpatch(1, pcpoint(1, 3, 3, 3), pcpoint(1, 4, 4, 4)), '2001-01-02'::timestamptz))) t(v);
-- {2@2001-01-01, 2@2001-01-02}
Combine multiple temporal values into a single one with all input instants merged in temporal order. All inputs must share the same pcid and subtype.
merge(tpcpoint) → tpcpoint, merge(tpcpatch) → tpcpatch
mergeAgg(tpcpoint) → tpcpoint, mergeAgg(tpcpatch) → tpcpatch
SELECT numInstants(mergeAgg(v)) FROM (VALUES (tpcpoint(pcpoint(1, 1, 1, 1), '2001-01-01'::timestamptz)), (tpcpoint(pcpoint(1, 2, 2, 2), '2001-01-02'::timestamptz))) t(v); -- 2
Streaming construction aggregates: appendInstant assembles instants into a sequence; appendSequence assembles sequences into a sequence set. Useful for trajectory loaders that consume rows in time order.
appendInstant(tpcpoint[,interp,maxt]) → tpcpoint, appendInstant(tpcpatch) → tpcpatch
appendInstantAgg(tpcpoint[,interp,maxt]) → tpcpoint, appendInstantAgg(tpcpatch) → tpcpatch
appendSequence(tpcpoint) → tpcpoint, appendSequence(tpcpatch) → tpcpatch
appendSequenceAgg(tpcpoint) → tpcpoint, appendSequenceAgg(tpcpatch) → tpcpatch
SELECT numInstants(appendInstant(v ORDER BY startTimestamp(v))) FROM (VALUES (tpcpoint(pcpoint(1, 1, 1, 1), '2001-01-01'::timestamptz)), (tpcpoint(pcpoint(1, 2, 2, 2), '2001-01-02'::timestamptz))) t(v); -- 2