Uses of Class
com.google.common.geometry.S2CellId
-
Uses of S2CellId in com.google.common.geometry
Fields in com.google.common.geometry declared as S2CellIdModifier and TypeFieldDescriptionprivate S2CellId
S2ShapeIndexCoder.EncodedS2ShapeIndex.LazyCell.cachedCellId
(package private) S2CellId
S2Cell.cellId
private S2CellId
S2CellIndex.CellNode.cellId
private final S2CellId
S2CellIndex.Delta.cellId
private static final S2CellId
S2ShapeIndex.RangeIterator.END
static final S2CellId[]
S2CellId.FACE_CELLS
private final S2CellId
S2ClosestPointQuery.QueueEntry.id
private S2CellId
S2PaddedCell.id
The cell being padded.private S2CellId
S2ShapeIndex.RangeIterator.id
private S2CellId
S2ShapeIndex.InteriorTracker.nextCellId
The ideal next cell ID such that the entry vertex of that cell would match the exit vertex of this cell.private static final S2CellId
S2CellId.NONE
private S2CellId
S2CellIndex.ContentsIterator.prevStartId
The value of it.startId() from the previous call to startUnion().private S2CellId
S2ShapeIndex.RangeIterator.rangeMax
private S2CellId
S2ShapeIndex.RangeIterator.rangeMin
private static final S2CellId
S2CellId.SENTINEL
private final S2CellId
S2CellIndex.Delta.startId
private final S2CellId
S2CellIndex.RangeNode.startId
First leaf cell contained by this range.Fields in com.google.common.geometry with type parameters of type S2CellIdModifier and TypeFieldDescriptionS2CellUnion.cellIds
The CellIds that form the UnionS2ClosestPointQuery.indexCovering
A small (invalid input: '<'6) cell covering of the indexed points.S2ClosestPointQuery.intersectionWithMaxDistance
The intersection between the index andS2ClosestPointQuery.maxDistance
.S2ClosestPointQuery.intersectionWithRegion
The intersection between the index andS2ClosestPointQuery.regionCovering
.S2ClosestPointQuery.maxDistanceCovering
The covering ofS2ClosestPointQuery.maxDistance
.S2ClosestPointQuery.regionCovering
The covering ofS2ClosestPointQuery.indexCovering
.S2RegionCoverer.ActiveCovering.result
Cell ids that have been added to the covering so far.S2Iterator.seekFunction
Methods in com.google.common.geometry that return S2CellIdModifier and TypeMethodDescriptionS2CellId.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.private static S2CellId
S2EdgeIndex.containingCell
(S2Point pa, S2Point pb) Returns the smallest cell containing both points, or Sentinel if they are not all on the same face.private static S2CellId
S2EdgeIndex.containingCell
(S2Point pa, S2Point pb, S2Point pc, S2Point pd) Returns the smallest cell containing all four points, orsentinel()
if they are not all on the same face.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).(package private) static S2CellId
S2CellId.fromDebugString
(String str) Returns a cell id decoded from a simple debug format.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.private static S2CellId
S2CellId.fromFaceIJWrap
(int face, int i, int j) Given a face and a point (i,j) where either i or j is outside the valid range [0..MAX_SIZE-1], this function first determines which neighboring face "contains" (i,j), and then returns the leaf cell on that face which is adjacent to the given face and whose distance from (i,j) is minimal.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 withPOS_BITS
bits), and level (range 0..MAX_LEVEL).static S2CellId
S2CellId.fromLatLng
(S2LatLng ll) Return the leaf cell containing the given S2LatLng.static S2CellId
Return the leaf cell containing the given point (a direction vector, not necessarily unit length).static S2CellId
Decodes the cell id from a compact text string suitable for display or indexing.private static S2CellId
S2CellId.fromTokenImpl
(String token, boolean implicitZeroes) Returns the cell id for the given token, which will be implicitly zero-right-padded to length 16 if 'implicitZeroes' is true.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.) The range is *inclusive* (i.e.S2ShapeIndex.RangeIterator.rangeMax()
S2CellId.rangeMin()
Returns the start of the range of cell ids that are contained within this cell (including itself.) The range is *inclusive* (i.e.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 S2CellIdModifier and TypeMethodDescriptionS2CellUnion.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 S2CellIdModifier and TypeMethodDescriptionvoid
Adds the given (cellId, label) pair to the index.private boolean
S2ClosestPointQuery.addCell
(S2CellId id, S2Iterator<S2PointIndex.Entry<T>> iter, boolean seek, S2ClosestPointQuery.Target target) Processes the cell atid
, adding the contents of the cell immediately, or if there are too many points, adding it to the queue to be subdivided.private static boolean
S2CellUnion.areSiblings
(S2CellId a, S2CellId b, S2CellId c, S2CellId d) Returns true if the given four cells have a common parent.boolean
Returns true if the focus is already at the entry vertex of the given S2CellId (provided that the caller callsS2ShapeIndex.InteriorTracker.doneCellId(S2CellId)
as each cell is processed).private boolean
S2Loop.LoopCrosser.cellCrossesAnySubcell
(S2ShapeIndex.S2ClippedShape aClipped, S2CellId bId) Given an index cell of A, returns true if there are any edge or wedge crossings with any index cell of B contained withinbId
.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.private void
S2ClosestPointQuery.coverRange
(S2CellId firstId, S2CellId lastId) Adds a cell to indexCovering that covers the given inclusive range.private static void
S2ShapeIndexRegion.coverRange
(S2CellId first, S2CellId last, List<S2CellId> cellIds) Computes the smallest S2Cell that covers the S2Cell range (first, last) and adds this cell to "cellIds".(package private) static S2ShapeIndex.S2ClippedShape.Contained
(package private) static S2ShapeIndex.S2ClippedShape
S2ShapeIndex.S2ClippedShape.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, int[] edges) (package private) static S2ShapeIndex.S2ClippedShape
S2ShapeIndex.S2ClippedShape.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, int offset, int count) (package private) static S2ShapeIndex.S2ClippedShape
S2ShapeIndex.S2ClippedShape.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, List<S2ShapeIndex.ClippedEdge> edges, int start, int end) (package private) static S2ShapeIndex.S2ClippedShape.EdgeRange
S2ShapeIndex.S2ClippedShape.EdgeRange.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, int offset, int count) (package private) static S2ShapeIndex.S2ClippedShape.ManyEdges
S2ShapeIndex.S2ClippedShape.ManyEdges.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, int[] edges) (package private) static S2ShapeIndex.S2ClippedShape.ManyEdges
S2ShapeIndex.S2ClippedShape.ManyEdges.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, List<S2ShapeIndex.ClippedEdge> edges, int start, int end) (package private) static final S2ShapeIndex.S2ClippedShape.OneEdge
S2ShapeIndex.S2ClippedShape.OneEdge.create
(S2CellId cellId, S2Shape shape, boolean containsCenter, S2ShapeIndex.ClippedEdge clippedEdge) void
S2ShapeIndex.InteriorTracker.doneCellId
(S2CellId cellid) Indicates that the caller has finished processing the given S2CellId.private static void
Given a region and a starting cell, return the set of all the edge-connected cells at the same level that intersect "region".int
S2CellId.getCommonAncestorLevel
(S2CellId other) Returns the level of the "lowest common ancestor" of this cell and "other".private void
S2CellUnion.getDifferenceInternal
(S2CellId cell, S2CellUnion y) 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
S2CellId.greaterOrEquals
(S2CellId x) boolean
S2CellId.greaterThan
(S2CellId x) private static int
S2CellUnion.indexedBinarySearch
(List<S2CellId> l, S2CellId key, int low) Just as normal binary search, except that it allows specifying the starting value for the lower bound.private void
void
S2CellUnion.initFromBeginEnd
(S2CellId begin, S2CellId end) AsS2CellUnion.initFromMinMax(S2CellId, S2CellId)
, except that the union covers the range of leaf cells from "begin" (inclusive) to "end" (exclusive.) Ifbegin.equals(end)
, the result is empty.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
Positions the iterator at the index cell containing the given cell, if possible, and returns theS2ShapeIndex.CellRelation
that describes the relationship between the index and the given target cell: ReturnsS2ShapeIndex.CellRelation.INDEXED
if the iterator was positioned at an index cell that is equal to or contains the given cell.(package private) abstract int
S2CellIdVector.lowerBound
(S2CellId target) Returns the index of the first elementx
such that(x >= target)
, orAbstractCollection.size()
if no such element exists.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
S2Iterator.seekForward
(S2CellId target) Advances the iterator to the next cell with id() >= target.private void
S2ShapeIndex.skipCellRange
(S2CellId begin, S2CellId end, S2ShapeIndex.InteriorTracker tracker, S2ShapeIndex.EdgeAllocator alloc) Skips over the cells in the given range, creating index cells if we are currently in the interior of at least one shape.static String
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.Method parameters in com.google.common.geometry with type arguments of type S2CellIdModifier and TypeMethodDescriptionvoid
Convenience function that adds a collection of cells with the same label.private static void
S2ShapeIndexRegion.coverRange
(S2CellId first, S2CellId last, List<S2CellId> cellIds) Computes the smallest S2Cell that covers the S2Cell range (first, last) and adds this cell to "cellIds".(package private) static <T extends S2Iterator.Entry>
S2Iterator<T> Same asS2Iterator.create(List)
, but acceptsseekFunction
, which is used as the implementation ofS2Iterator.seek(S2CellId)
.static S2LaxPolylineShape
S2LaxPolylineShape.createMultiSnapped
(Iterable<? extends Iterable<S2CellId>> lines) AsS2LaxPolylineShape.create(com.google.common.geometry.S2Polyline)
, but with vertices at the center of cell IDs, packed into a long[].static S2LaxPolygonShape
S2LaxPolygonShape.createSnapped
(Iterable<? extends Iterable<S2CellId>> loops) AsS2LaxPolygonShape.create(com.google.common.geometry.S2Polygon)
, but packs vertices into a long[] array.static S2LaxPolylineShape
S2LaxPolylineShape.createSnapped
(Iterable<S2CellId> vertices) AsS2LaxPolylineShape.create(com.google.common.geometry.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
S2CellIdVectorCoder.encode
(List<S2CellId> values, OutputStream output) private static void
Given a region and a starting cell, return the set of all the edge-connected cells at the same level that intersect "region".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.private int
S2EdgeIndex.getCovering
(S2Point a, S2Point b, boolean thickenEdge, ArrayList<S2CellId> edgeCovering) Computes a cell covering of an edge.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.private void
S2EdgeIndex.getEdgesInChildrenCells
(S2Point a, S2Point b, List<S2CellId> cover, Set<Integer> candidateCrossings) Appends to candidateCrossings the edges that are fully contained in an S2 covering of edge.private void
S2EdgeIndex.getEdgesInParentCells
(List<S2CellId> cover, Set<Integer> candidateCrossings) Adds to candidateCrossings all the edges present in any ancestor of any cell of cover, down to minimumS2LevelUsed.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
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.private static void
S2RegionCoverer.getRawFastCovering
(S2Cap cap, int maxCellsHint, List<S2CellId> covering) Compute a covering of the given cap.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".private static int
S2CellUnion.indexedBinarySearch
(List<S2CellId> l, S2CellId key, int low) Just as normal binary search, except that it allows specifying the starting value for the lower bound.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
Populates a cell union with the given S2CellIds.static boolean
LikeS2CellUnion.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).private static long[]
Constructors in com.google.common.geometry with parameters of type S2CellIdModifierConstructorDescriptionprivate
private
private
(package private)
QueueEntry
(S1ChordAngle distance, S2CellId id) private
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 S2CellIdModifierConstructorDescription(package private)
MultiSnapped
(Iterable<? extends Iterable<S2CellId>> loops) (package private)
MultiSnapped
(Iterable<? extends Iterable<S2CellId>> chains) protected
S2Iterator
(List<T> entries, com.google.common.base.Function<S2CellId, Integer> seekFunction) Same asS2Iterator(List)
, but acceptsseekFunction
, which is used as the implementation ofS2Iterator.seek(S2CellId)
.(package private)
SimpleSnapped
(Iterable<S2CellId> vertices) private
SimpleSnapped
(Iterable<S2CellId> vertices)