The following static helpers return an h3indexset (or intset for h3GetIcosahedronFaces), the finite-collection companion type of h3index. They operate on a static h3index (or an h3indexset) and are not lifted to th3index; the temporal lift is deferred pending a tset<T> primitive.
All cells within k grid steps of the origin (inclusive of the origin at k=0).
h3GridDisk(h3index, integer) → h3indexset
SELECT h3GridDisk(h3index '871fa44a8ffffff', 1);
-- {"871fa44a8ffffff", "871fa44a9ffffff", "871fa44aaffffff", "871fa44abffffff",
-- "871fa44acffffff", "871fa44adffffff", "871fa44aeffffff"}
The cells at exactly k grid steps from the origin. Fails near pentagons.
h3GridRing(h3index, integer) → h3indexset
SELECT h3GridRing(h3index '871fa44a8ffffff', 1);
-- {"871fa44a9ffffff", "871fa44aaffffff", "871fa44abffffff", "871fa44acffffff",
-- "871fa44adffffff", "871fa44aeffffff"}
The inclusive path of cells between two cells of the same resolution.
h3GridPathCells(h3index, h3index) → h3indexset
SELECT h3GridPathCells(h3index '871fa44a8ffffff', h3index '871fa44b1ffffff');
-- {"871fa4484ffffff", "871fa44a3ffffff", "871fa44a8ffffff", "871fa44aeffffff",
-- "871fa44b1ffffff"}
All children of a cell at the given target resolution.
h3CellToChildren(h3index, integer) → h3indexset
SELECT h3CellToChildren(h3index '831c02fffffffff', 4);
-- {"841c021ffffffff", "841c023ffffffff", "841c025ffffffff", "841c027ffffffff",
-- "841c029ffffffff", "841c02bffffffff", "841c02dffffffff"}
Compacted representation of a cell set, finer cells are merged into their parent whenever a full hexagonal set of siblings is present.
h3CompactCells(h3indexset) → h3indexset
SELECT h3CompactCells(h3CellToChildren(h3index '831c02fffffffff', 4));
-- {"831c02fffffffff"}
Uncompacted representation at the given resolution, the inverse of h3CompactCells.
h3UncompactCells(h3indexset, integer) → h3indexset
SELECT numValues(h3UncompactCells( h3CompactCells(h3CellToChildren(h3index '831c02fffffffff', 4)), 4)); -- 7
All outgoing directed edges of a cell (6 for hexagons, 5 for pentagons).
h3OriginToDirectedEdges(h3index) → h3indexset
SELECT h3OriginToDirectedEdges(h3index '871fa44a8ffffff');
-- {"1171fa44a8ffffff", "1271fa44a8ffffff", "1371fa44a8ffffff",
-- "1471fa44a8ffffff", "1571fa44a8ffffff", "1671fa44a8ffffff"}
All vertexes of a cell (6 for hexagons, 5 for pentagons).
h3CellToVertexes(h3index) → h3indexset
SELECT h3CellToVertexes(h3index '871fa44a8ffffff');
-- {"2071fa44a8ffffff", "2171fa44a8ffffff", "2271fa44a8ffffff",
-- "2371fa44a8ffffff", "2471fa44a8ffffff", "2571fa44a8ffffff"}
The icosahedron face indexes (0..19) intersected by a cell.
h3GetIcosahedronFaces(h3index) → intset
SELECT h3GetIcosahedronFaces(h3index '831c02fffffffff');
-- {6, 11}