Return the temporal parent cell at the given resolution
cellToParent(cell,integer) → cell cellToParent(tcell,integer) → tcell cellToParent(tcell) → tcell
Return the ancestor of a cell at the given coarser resolution. The static form takes a single cell; the temporal form returns the ancestor of each cell in a trajectory. The no-argument form drops to the next-coarser resolution.
SELECT getResolution(cellToParent(h3index '8a2a1072b59ffff', 5)); -- 5 SELECT getResolution(cellToParent(th3index '8a2a1072b59ffff@2001-01-01', 5)); -- 5@2001-01-01 SELECT getResolution(cellToParent(quadbin '48a6227affffffff', 5)); -- 5 SELECT getResolution(cellToParent(tquadbin '48a6227affffffff@2001-01-01', 5)); -- 5@2001-01-01 SELECT getResolution(cellToParent(s2cell '47c3c', 5)); -- 5 SELECT getResolution(cellToParent(ts2cell '47c3c@2001-01-01', 5)); -- 5@2001-01-01
Return the cells covering a cell, or the cells of a cell set, at the given resolution
cellToCover(h3index,integer) → h3indexset cellToCover(quadbin,integer) → quadbinset cellToCover(s2cell,integer) → s2cellset coverCells(h3indexset,integer) → h3indexset coverCells(quadbinset,integer) → quadbinset coverCells(s2cellset,integer) → s2cellset
The cover holds the cells that hold a point of the cell, each point assigned to its cell as latLngToCell assigns it, which is what geoToH3IndexSet states for a geometry. A trajectory passing through the cell therefore takes a cell of the cover there, so reading the values of a temporal cell this way states a cover of its trajectory at a resolution its values are not stored at, without reading the trajectory again. The resolution is the cell's own or a coarser one, and a finer one raises an error. A QUADBIN tile and an S2 cell are each exactly the union of their four children, so their cover at a coarser resolution is their ancestor there (cellToParent). The parent of an H3 cell is not its cover: the children of a hexagon do not tile it, so an H3 cell can reach cells other than its parent.
SELECT cellToCover(h3index '8c1f005018733ff', 10);
-- {"8a1f00501877fff"}
SELECT coverCells(getValues(th3index '{8c1f005018733ff@2001-01-01,
8c1f005018731ff@2001-01-02}'), 10);
-- {"8a1f00501877fff"}
SELECT cellToCover(quadbin '48a6227affffffff', 7);
-- {"4876227fffffffff"}
SELECT coverCells(getValues(tquadbin '{48a6227affffffff@2001-01-01,
48a6227bffffffff@2001-01-02}'), 7);
-- {"4876227fffffffff"}
SELECT cellToCover(s2cell '47c3c', 5);
-- {"47c4"}
SELECT coverCells(cellToChildren(s2cell '47c3c', 9), 7);
-- {"47c3c"}