Uses of Class
com.google.common.geometry.S2CellId

  • Uses of S2CellId in com.google.common.geometry

    Classes in com.google.common.geometry that implement interfaces with type arguments of type S2CellId
    Modifier and Type
    Class
    Description
    final class 
    An S2CellId is a 64-bit unsigned integer that uniquely identifies a cell in the S2 cell decomposition.
    class 
    An S2CellUnion is a region consisting of cells of various sizes.
    Fields in com.google.common.geometry declared as S2CellId
    Modifier and Type
    Field
    Description
    static final S2CellId[]
    S2CellId.FACE_CELLS
     
    Methods in com.google.common.geometry that return S2CellId
    Modifier and Type
    Method
    Description
    S2CellId.advance(long steps)
    This method advances or retreats the indicated number of steps along the Hilbert curve at the current level, and returns the new position.
    S2CellId.advanceWrap(long steps)
    This method advances or retreats the indicated number of steps along the Hilbert curve at the current level, and returns the new position.
    static S2CellId
    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.
    S2CellUnion.cellId(int i)
    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).
    S2CellId.childBegin()
    Returns the first child in a traversal of the children of this cell, in Hilbert curve order.
    S2CellId.childBegin(int level)
    Returns the first cell in a traversal of children a given level deeper than this cell, in Hilbert curve order.
    S2CellId.childEnd()
    Returns the first cell after a traversal of the children of this cell in Hilbert curve order.
    S2CellId.childEnd(int level)
    Returns the first cell after the last child in a traversal of children a given level deeper than this cell, in Hilbert curve order.
    static S2CellId
    S2CellId.end(int level)
    Returns the first cell after an ordered traversal along the Hilbert curve at a given level (across all 6 faces of the cube).
    static S2CellId
    S2CellId.fromFace(int face)
    Returns the cell corresponding to a given S2 cube face.
    static S2CellId
    S2CellId.fromFaceIJ(int face, int i, int j)
    Return a leaf cell given its cube face (range 0..5) and i- and j-coordinates (see s2.h).
    static S2CellId
    S2CellId.fromFaceIJSame(int face, int i, int j, boolean sameFace)
    Public helper function that calls FromFaceIJ if sameFace is true, or FromFaceIJWrap if sameFace is false.
    static S2CellId
    S2CellId.fromFacePosLevel(int face, long pos, int level)
    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).
    static S2CellId
    S2CellId.fromLatLng(S2LatLng ll)
    Return the leaf cell containing the given S2LatLng.
    static S2CellId
    S2CellId.fromPoint(S2Point p)
    Return the leaf cell containing the given point (a direction vector, not necessarily unit length).
    static S2CellId
    S2CellId.fromToken(String token)
    Decodes the cell id from a compact text string suitable for display or indexing.
    S2Cell.id()
     
    S2Iterator.id()
    Returns the cell id for the current cell.
    S2PaddedCell.id()
    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.
    static S2CellId
    S2TextFormat.makeCellId(String str)
    As above, but does not CHECK-fail on invalid input.
    static S2CellId
    S2TextFormat.makeCellIdOrDie(String str)
    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.
    S2CellId.next()
    Return the next cell at the same level along the Hilbert curve.
    S2CellId.nextWrap()
    Like next(), but wraps around from the last face to the first and vice versa.
    static S2CellId
    S2CellId.none()
    The default constructor returns an invalid cell id.
    S2CellId.parent()
     
    S2CellId.parent(int level)
    Return the cell at the previous level or at the given level (which must be less than or equal to the current level).
    S2CellId.prev()
    Return the previous cell at the same level along the Hilbert curve.
    S2CellId.prevWrap()
    Like prev(), but wraps around from the last face to the first and vice versa.
    S2CellId.rangeMax()
    Returns the end of the range of cell ids that are contained within this cell (including itself.)
    S2ShapeIndex.RangeIterator.rangeMax()
     
    S2CellId.rangeMin()
    Returns the start of the range of cell ids that are contained within this cell (including itself.)
    S2ShapeIndex.RangeIterator.rangeMin()
    Returns the min and max leaf cell ids covered by the current cell.
    static S2CellId
    S2CellId.sentinel()
    Returns an invalid cell id guaranteed to be larger than any valid cell id.
    S2PaddedCell.shrinkToFit(R2Rect rect)
    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.
    Methods in com.google.common.geometry that return types with arguments of type S2CellId
    Modifier and Type
    Method
    Description
    S2CellUnion.cellIds()
    Direct access to the underlying vector for iteration .
    S2CellId.children()
     
    S2CellId.childrenAtLevel(int level)
     
    S2CellUnion.iterator()
    Enable iteration over the union's cells.
    Methods in com.google.common.geometry with parameters of type S2CellId
    Modifier and Type
    Method
    Description
    void
    S2CellIndex.add(S2CellId cellId, int label)
    Adds the given (cellId, label) pair to the index.
    int
    S2CellId.compareTo(S2CellId that)
     
    int
    S2Iterator.compareTo(S2CellId cellId)
    Returns the comparison from the current iterator cell to the given cell ID.
    boolean
    S2CellId.contains(S2CellId other)
    Return true if the given cell is contained within this one.
    boolean
    S2CellUnion.contains(S2CellId id)
    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
    S2CellId.getEdgeNeighbors(S2CellId[] neighbors)
    Return the four cells that are adjacent across the cell's four edges.
    void
    S2CellUnion.getIntersection(S2CellUnion x, S2CellId id)
    Specialized version of GetIntersection() that gets the intersection of a cell union with the given cell id.
    boolean
     
    boolean
    S2CellId.greaterThan(S2CellId x)
     
    void
    S2CellUnion.initFromBeginEnd(S2CellId begin, S2CellId end)
    As S2CellUnion.initFromMinMax(S2CellId, S2CellId), except that the union covers the range of leaf cells from "begin" (inclusive) to "end" (exclusive.)
    void
    S2CellUnion.initFromMinMax(S2CellId minId, S2CellId maxId)
    Create a cell union that corresponds to a continuous range of cell ids.
    boolean
    S2CellId.intersects(S2CellId other)
    Return true if the given cell intersects this one.
    boolean
    S2CellUnion.intersects(S2CellId id)
    Return true if the cell union intersects the given cell id.
    boolean
    S2CellId.lessOrEquals(S2CellId x)
     
    boolean
    S2CellId.lessThan(S2CellId x)
     
    S2Iterator.locate(S2CellId target)
    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
    S2CellIndex.NonEmptyRangeIterator.seek(S2CellId target)
     
    void
    S2CellIndex.RangeIterator.seek(S2CellId target)
    Positions the iterator at the range containing "target".
    void
    S2Iterator.seek(S2CellId target)
    Positions the iterator at the first cell with id() >= target, or at the end of the index if no such cell exists.
    void
    S2Iterator.seekForward(S2CellId target)
    Advances the iterator to the next cell with id() >= target.
    static String
    S2TextFormat.toString(S2CellId cellId)
    Convert an S2CellId to the S2TextFormat string representation documented above.
    boolean
    S2CellIndex.CellVisitor.visit(S2CellId cellId, int label)
    Provides a (cellId, label) pair to this visitor, which may return true to keep searching.
    Method parameters in com.google.common.geometry with type arguments of type S2CellId
    Modifier and Type
    Method
    Description
    void
    S2CellIndex.add(Iterable<S2CellId> cellIds, int label)
    Convenience function that adds a collection of cells with the same label.
    S2LaxPolylineShape.createMultiSnapped(Iterable<? extends Iterable<S2CellId>> lines)
    As S2LaxPolylineShape.create(S2Polyline), but with vertices at the center of cell IDs, packed into a long[].
    S2LaxPolygonShape.createSnapped(Iterable<? extends Iterable<S2CellId>> loops)
    As S2LaxPolygonShape.create(S2Polygon), but packs vertices into a long[] array.
    S2LaxPolylineShape.createSnapped(Iterable<S2CellId> vertices)
    As S2LaxPolylineShape.create(S2Polyline), but with vertices at the center of cell IDs, packed into a long[].
    void
    S2CellUnion.denormalize(int minLevel, int levelMod, ArrayList<S2CellId> output)
    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
    S2CellId.getAllNeighbors(int nbrLevel, List<S2CellId> output)
    Append all neighbors of this cell at the given level to "output".
    void
    S2ShapeIndexRegion.getCellUnionBound(List<S2CellId> cellIds)
    Clears the given list of cells and adds the cell union of this index.
    void
    S2RegionCoverer.getCovering(S2Region region, ArrayList<S2CellId> covering)
    Computes a list of cell ids that covers the given region and satisfies the various restrictions specified above.
    void
    S2RegionCoverer.getFastCovering(S2Cap cap, ArrayList<S2CellId> results)
    Like GetCovering(), except that this method is much faster and the coverings are not as tight.
    void
    S2RegionCoverer.getInteriorCovering(S2Region region, ArrayList<S2CellId> interior)
    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
    S2CellUnion.getIntersection(List<S2CellId> x, List<S2CellId> y, List<S2CellId> results)
    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
    S2RegionCoverer.getSimpleCovering(S2Region region, S2Point start, int level, ArrayList<S2CellId> output)
    Given a connected region and a starting point, return a set of cells at the given level that cover the region.
    void
    S2CellId.getVertexNeighbors(int level, Collection<S2CellId> output)
    Return the neighbors of closest vertex to this cell at the given level, by appending them to "output".
    void
    S2CellUnion.initFromCellIds(ArrayList<S2CellId> cellIds)
    Populates a cell union with the given S2CellIds, and then calls normalize().
    void
    S2CellUnion.initRawCellIds(ArrayList<S2CellId> cellIds)
    Populates a cell union with the given S2CellIds.
    void
    S2CellUnion.initRawSwap(List<S2CellId> cellIds)
    Like the initFrom*() constructors, but does not call normalize().
    void
    S2CellUnion.initSwap(List<S2CellId> cellIds)
    Populates a cell union with the given S2CellIds.
    static boolean
    S2CellUnion.normalize(List<S2CellId> ids)
    Like S2CellUnion.normalize(), but works directly with a vector of S2CellIds.
    void
    S2RegionCoverer.normalizeCovering(ArrayList<S2CellId> covering)
    Normalize "covering" so that it conforms to the current covering parameters (maxCells, minLevel, maxLevel, and levelMod).
    Constructors in com.google.common.geometry with parameters of type S2CellId
    Modifier
    Constructor
    Description
     
    An S2Cell always corresponds to a particular S2CellId.
     
    S2PaddedCell(S2CellId id, double padding)
    Construct an S2PaddedCell for the given cell id and padding.
    Constructor parameters in com.google.common.geometry with type arguments of type S2CellId
    Modifier
    Constructor
    Description
    protected
    S2Iterator(List<T> entries, com.google.common.base.Function<S2CellId,Integer> seekFunction)
    Same as S2Iterator(List), but accepts seekFunction, which is used as the implementation of S2Iterator.seek(S2CellId).