This method advances or retreats the indicated number of steps along the Hilbert curve at the
current level, and returns the new position.
This method advances or retreats the indicated number of steps along the Hilbert curve at the
current level, and returns the new position.
S2CellId.begin(int level)
Returns the first cell in an ordered traversal along the Hilbert curve at a given level (across
all 6 faces of the cube).
S2CellIndex.CellIterator.cellId()
Returns the S2CellId of the current (cellId, label) pair.
S2CellIndex.ContentsIterator.cellId()
Returns the S2CellId of the current (cellId, label) pair.
Convenience methods for accessing the individual cell ids.
S2CellId.child(int position)
Returns the immediate child of this cell at the given traversal order position (in the range 0
to 3).
Returns the first child in a traversal of the children of this cell, in Hilbert curve order.
Returns the first cell in a traversal of children a given level deeper than this cell, in
Hilbert curve order.
Returns the first cell after a traversal of the children of this cell in Hilbert curve order.
Returns the first cell after the last child in a traversal of children a given level deeper
than this cell, in Hilbert curve order.
Returns the first cell after an ordered traversal along the Hilbert curve at a given level
(across all 6 faces of the cube).
Returns the cell corresponding to a given S2 cube face.
Return a leaf cell given its cube face (range 0..5) and i- and j-coordinates (see s2.h).
Public helper function that calls FromFaceIJ if sameFace is true, or FromFaceIJWrap if sameFace
is false.
Returns a cell given its face (range 0..5), Hilbert curve position within that face (an
unsigned integer with
S2CellId.POS_BITS bits), and level (range 0..MAX_LEVEL).
Return the leaf cell containing the given S2LatLng.
Return the leaf cell containing the given point (a direction vector, not necessarily unit
length).
Decodes the cell id from a compact text string suitable for display or indexing.
Returns the cell id for the current cell.
Returns the ID of this padded cell.
S2ShapeIndex.RangeIterator.id()
Returns the current S2CellId or cell contents.
S2CellIndex.RangeIterator.limitId()
The (non-inclusive) end of the current range of leaf S2CellIds.
As above, but does not CHECK-fail on invalid input.
Parses an S2CellId in the format "f/dd..d" where "f" is a digit in the range [0-5] representing
the S2CellId face, and "dd..d" is a string of digits in the range [0-3] representing each
child's position with respect to its parent.
Return the next cell at the same level along the Hilbert curve.
Like next(), but wraps around from the last face to the first and vice versa.
The default constructor returns an invalid cell id.
Return the cell at the previous level or at the given level (which must be less than or equal
to the current level).
Return the previous cell at the same level along the Hilbert curve.
Like prev(), but wraps around from the last face to the first and vice versa.
Returns the end of the range of cell ids that are contained within this cell (including
itself.)
Returns the start of the range of cell ids that are contained within this cell (including
itself.)
Returns the min and max leaf cell ids covered by the current cell.
Returns an invalid cell id guaranteed to be larger than any valid cell id.
Returns the smallest cell that contains all descendants of this cell whose bounds intersect
"rect".
S2CellIndex.RangeIterator.startId()
Returns the start of the current range of leaf S2CellIds.
void
Adds the given (cellId, label) pair to the index.
int
int
Returns the comparison from the current iterator cell to the given cell ID.
boolean
Return true if the given cell is contained within this one.
boolean
Return true if the cell union contains the given cell id.
int
Returns the level of the "lowest common ancestor" of this cell and "other".
void
Return the four cells that are adjacent across the cell's four edges.
void
Specialized version of GetIntersection() that gets the intersection of a cell union with the
given cell id.
boolean
boolean
void
void
Create a cell union that corresponds to a continuous range of cell ids.
boolean
Return true if the given cell intersects this one.
boolean
Return true if the cell union intersects the given cell id.
boolean
boolean
Positions the iterator at the index cell containing the given cell, if possible, and returns
the
S2ShapeIndex.CellRelation that describes the relationship between the index and the given target
cell:
Returns
S2ShapeIndex.CellRelation.INDEXED if the iterator was positioned at an index cell that
is equal to or contains the given cell.
void
void
Positions the iterator at the range containing "target".
void
Positions the iterator at the first cell with id() >= target, or at the end of the index if no
such cell exists.
void
Advances the iterator to the next cell with id() >= target.
Convert an S2CellId to the S2TextFormat string representation documented above.
boolean
Provides a (cellId, label) pair to this visitor, which may return true to keep searching.
void
Convenience function that adds a collection of cells with the same label.
void
Replaces "output" with an expanded version of the cell union where any cells whose level is
less than "min_level" or where (level - min_level) is not a multiple of "level_mod" are
replaced by their children, until either both of these conditions are satisfied or the maximum
level is reached.
void
Append all neighbors of this cell at the given level to "output".
void
Clears the given list of cells and adds the cell union of this index.
void
Computes a list of cell ids that covers the given region and satisfies the various restrictions
specified above.
void
Like GetCovering(), except that this method is much faster and the coverings are not as tight.
void
Computes a list of cell ids that is contained within the given region and satisfies the various
restrictions specified above; note that if the max cell level is not specified very carefully
this method can try to create an enormous number of cells, wasting a lot of time and memory, so
care should be taken to set a max level suitable for the scale of the region being covered.
static void
Like #getIntersection(S2CellUnion, S2CellUnion), but works directly with lists of
S2CellIds, and this method has slightly more relaxed normalization requirements: the input
vectors may contain groups of 4 child cells that all have the same parent.
static void
Given a connected region and a starting point, return a set of cells at the given level that
cover the region.
void
Return the neighbors of closest vertex to this cell at the given level, by appending them to
"output".
void
Populates a cell union with the given S2CellIds, and then calls normalize().
void
Populates a cell union with the given S2CellIds.
void
Like the initFrom*() constructors, but does not call normalize().
void
Populates a cell union with the given S2CellIds.
static boolean
void
Normalize "covering" so that it conforms to the current covering parameters (maxCells,
minLevel, maxLevel, and levelMod).