The following operators compare the spatiotemporal bounding box of temporal cells rather than containment in the cell hierarchy. tcell is a spatial temporal type: its bounding box is an stbox that combines the geodetic spatial extent of the cell boundaries (their longitude/latitude envelope in SRID 4326) with the trajectory's tstzspan time period. The operators below compare that box along the spatial and/or temporal axes. See the indexing section for the opclasses that make these operators index-capable.
The @> operator tests spatiotemporal bounding-box containment (spatial extent and time together), not containment in the cell hierarchy. To test whether one cell is the ancestor of another at a given resolution, use cellToParent.
Return the spatiotemporal bounding box of a temporal cell, or that box expanded in the spatial dimension by a float value
stbox(tcell) → stbox expandSpace(tcell,float) → stbox
The box is the geodetic envelope of the cell boundaries together with the trajectory's time period, so it is the key both index operator classes of the indexing section store.
SELECT round(stbox(tquadbin '48a6227affffffff@2001-01-01'), 6); -- SRID=4326;STBOX XT(((4.21875,50.736455),(4.570313,50.958427)),[2001-01-01, 2001-01-01]) SELECT round(expandSpace(tquadbin '48a6227affffffff@2001-01-01', 1), 6); -- SRID=4326;STBOX XT(((3.21875,49.736455),(5.570313,51.958427)),[2001-01-01, 2001-01-01])
Topological operators
{tstzspan,stbox,tcell} {&&, <@, @>, ~=, -|-} {tstzspan,stbox,tcell} → boolean
Bounding-box overlap, contains, contained-by, same, and adjacent
SELECT th3index '871fa44a8ffffff@2001-01-01' && tstzspan '[2001-01-01, 2001-01-02]'; -- t SELECT th3index '871fa44a8ffffff@2001-01-01' ~= th3index '871fa44a8ffffff@2001-01-01'; -- t SELECT tquadbin '485623ffffffffff@2001-01-01' && tstzspan '[2001-01-01, 2001-01-02]'; -- t SELECT tquadbin '485623ffffffffff@2001-01-01' ~= tquadbin '485623ffffffffff@2001-01-01'; -- t SELECT ts2cell '47c3c@2001-01-01' && tstzspan '[2001-01-01, 2001-01-02]'; -- t SELECT ts2cell '47c3c@2001-01-01' ~= ts2cell '47c3c@2001-01-01'; -- t
Position operators
{stbox,tcell} {<<, &<, >>, &>} {stbox,tcell} → boolean
{stbox,tcell} {<<|, &<|, |>>, |&>} {stbox,tcell} → boolean
{tstzspan,stbox,tcell} {<<#, &<#, #>>, #&>} {tstzspan,stbox,tcell} → boolean
Relative position along the spatial axes (strictly-left, overlaps-left, overlaps-right, strictly-right; strictly-below, overlaps-below, overlaps-above, strictly-above) and along the time axis (strictly-before, overlaps-before, strictly-after, overlaps-after)
SELECT th3index '871fa44a8ffffff@2001-01-01' << th3index '871fa44aeffffff@2001-01-01'; -- f SELECT tquadbin '485623ffffffffff@2001-01-01' << tquadbin '48b6227abfffffff@2001-01-01'; -- f SELECT ts2cell '47c3c@2001-01-01' << ts2cell '47c4@2001-01-01'; -- f
SELECT th3index '871fa44a8ffffff@2001-01-01' <<# th3index '871fa44aeffffff@2001-01-05'; -- t SELECT th3index '871fa44a8ffffff@2001-01-01' #>> th3index '871fa44aeffffff@2001-01-05'; -- f SELECT tquadbin '485623ffffffffff@2001-01-01' <<# tquadbin '48b6227abfffffff@2001-01-05'; -- t SELECT tquadbin '485623ffffffffff@2001-01-01' #>> tquadbin '48b6227abfffffff@2001-01-05'; -- f SELECT ts2cell '47c3c@2001-01-01' <<# ts2cell '47c3c@2001-01-05'; -- t SELECT ts2cell '47c3c@2001-01-01' #>> ts2cell '47c3c@2001-01-05'; -- f