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 S2CellIdS2ShapeIndexCoder.EncodedS2ShapeIndex.LazyCell.cachedCellId(package private) S2CellIdS2Cell.cellIdprivate S2CellIdS2CellIndex.CellNode.cellIdprivate final S2CellIdS2CellIndex.Delta.cellIdprivate static final S2CellIdS2ShapeIndex.RangeIterator.ENDstatic final S2CellId[]S2CellId.FACE_CELLSprivate final S2CellIdS2ClosestPointQuery.QueueEntry.idprivate S2CellIdS2PaddedCell.idThe cell being padded.private S2CellIdS2ShapeIndex.RangeIterator.idprivate S2CellIdS2ShapeIndex.InteriorTracker.nextCellIdThe ideal next cell ID such that the entry vertex of that cell would match the exit vertex of this cell.private static final S2CellIdS2CellId.NONEprivate S2CellIdS2CellIndex.ContentsIterator.prevStartIdThe value of it.startId() from the previous call to startUnion().private S2CellIdS2ShapeIndex.RangeIterator.rangeMaxprivate S2CellIdS2ShapeIndex.RangeIterator.rangeMinprivate static final S2CellIdS2CellId.SENTINELprivate final S2CellIdS2CellIndex.Delta.startIdprivate final S2CellIdS2CellIndex.RangeNode.startIdFirst leaf cell contained by this range.Fields in com.google.common.geometry with type parameters of type S2CellIdModifier and TypeFieldDescriptionS2CellUnion.cellIdsThe CellIds that form the UnionS2ClosestPointQuery.indexCoveringA small (invalid input: '<'6) cell covering of the indexed points.S2ClosestPointQuery.intersectionWithMaxDistanceThe intersection between the index andS2ClosestPointQuery.maxDistance.S2ClosestPointQuery.intersectionWithRegionThe intersection between the index andS2ClosestPointQuery.regionCovering.S2ClosestPointQuery.maxDistanceCoveringThe covering ofS2ClosestPointQuery.maxDistance.S2ClosestPointQuery.regionCoveringThe covering ofS2ClosestPointQuery.indexCovering.S2RegionCoverer.ActiveCovering.resultCell ids that have been added to the covering so far.S2Iterator.seekFunctionMethods 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 S2CellIdS2CellId.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 S2CellIdS2EdgeIndex.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 S2CellIdS2EdgeIndex.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 S2CellIdS2CellId.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 S2CellIdS2CellId.fromDebugString(String str) Returns a cell id decoded from a simple debug format.static S2CellIdS2CellId.fromFace(int face) Returns the cell corresponding to a given S2 cube face.static S2CellIdS2CellId.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 S2CellIdS2CellId.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 S2CellIdS2CellId.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 S2CellIdS2CellId.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_BITSbits), and level (range 0..MAX_LEVEL).static S2CellIdS2CellId.fromLatLng(S2LatLng ll) Return the leaf cell containing the given S2LatLng.static S2CellIdReturn the leaf cell containing the given point (a direction vector, not necessarily unit length).static S2CellIdDecodes the cell id from a compact text string suitable for display or indexing.private static S2CellIdS2CellId.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 S2CellIdS2TextFormat.makeCellId(String str) As above, but does not CHECK-fail on invalid input.static S2CellIdS2TextFormat.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 S2CellIdS2CellId.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 S2CellIdS2CellId.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 TypeMethodDescriptionvoidAdds the given (cellId, label) pair to the index.private booleanS2ClosestPointQuery.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 booleanS2CellUnion.areSiblings(S2CellId a, S2CellId b, S2CellId c, S2CellId d) Returns true if the given four cells have a common parent.booleanReturns 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 booleanS2Loop.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.intintReturns the comparison from the current iterator cell to the given cell ID.booleanReturn true if the given cell is contained within this one.booleanReturn true if the cell union contains the given cell id.private voidS2ClosestPointQuery.coverRange(S2CellId firstId, S2CellId lastId) Adds a cell to indexCovering that covers the given inclusive range.private static voidS2ShapeIndexRegion.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.S2ClippedShapeS2ShapeIndex.S2ClippedShape.create(S2CellId cellId, S2Shape shape, boolean containsCenter, int[] edges) (package private) static S2ShapeIndex.S2ClippedShapeS2ShapeIndex.S2ClippedShape.create(S2CellId cellId, S2Shape shape, boolean containsCenter, int offset, int count) (package private) static S2ShapeIndex.S2ClippedShapeS2ShapeIndex.S2ClippedShape.create(S2CellId cellId, S2Shape shape, boolean containsCenter, List<S2ShapeIndex.ClippedEdge> edges, int start, int end) (package private) static S2ShapeIndex.S2ClippedShape.EdgeRangeS2ShapeIndex.S2ClippedShape.EdgeRange.create(S2CellId cellId, S2Shape shape, boolean containsCenter, int offset, int count) (package private) static S2ShapeIndex.S2ClippedShape.ManyEdgesS2ShapeIndex.S2ClippedShape.ManyEdges.create(S2CellId cellId, S2Shape shape, boolean containsCenter, int[] edges) (package private) static S2ShapeIndex.S2ClippedShape.ManyEdgesS2ShapeIndex.S2ClippedShape.ManyEdges.create(S2CellId cellId, S2Shape shape, boolean containsCenter, List<S2ShapeIndex.ClippedEdge> edges, int start, int end) (package private) static final S2ShapeIndex.S2ClippedShape.OneEdgeS2ShapeIndex.S2ClippedShape.OneEdge.create(S2CellId cellId, S2Shape shape, boolean containsCenter, S2ShapeIndex.ClippedEdge clippedEdge) voidS2ShapeIndex.InteriorTracker.doneCellId(S2CellId cellid) Indicates that the caller has finished processing the given S2CellId.private static voidGiven a region and a starting cell, return the set of all the edge-connected cells at the same level that intersect "region".intS2CellId.getCommonAncestorLevel(S2CellId other) Returns the level of the "lowest common ancestor" of this cell and "other".private voidS2CellUnion.getDifferenceInternal(S2CellId cell, S2CellUnion y) voidS2CellId.getEdgeNeighbors(S2CellId[] neighbors) Return the four cells that are adjacent across the cell's four edges.voidS2CellUnion.getIntersection(S2CellUnion x, S2CellId id) Specialized version of GetIntersection() that gets the intersection of a cell union with the given cell id.booleanS2CellId.greaterOrEquals(S2CellId x) booleanS2CellId.greaterThan(S2CellId x) private static intS2CellUnion.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 voidvoidS2CellUnion.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.voidS2CellUnion.initFromMinMax(S2CellId minId, S2CellId maxId) Create a cell union that corresponds to a continuous range of cell ids.booleanS2CellId.intersects(S2CellId other) Return true if the given cell intersects this one.booleanS2CellUnion.intersects(S2CellId id) Return true if the cell union intersects the given cell id.booleanS2CellId.lessOrEquals(S2CellId x) booleanPositions the iterator at the index cell containing the given cell, if possible, and returns theS2ShapeIndex.CellRelationthat describes the relationship between the index and the given target cell: ReturnsS2ShapeIndex.CellRelation.INDEXEDif the iterator was positioned at an index cell that is equal to or contains the given cell.(package private) abstract intS2CellIdVector.lowerBound(S2CellId target) Returns the index of the first elementxsuch that(x >= target), orAbstractCollection.size()if no such element exists.voidvoidPositions the iterator at the range containing "target".voidPositions the iterator at the first cell with id() >= target, or at the end of the index if no such cell exists.voidS2Iterator.seekForward(S2CellId target) Advances the iterator to the next cell with id() >= target.private voidS2ShapeIndex.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 StringConvert an S2CellId to the S2TextFormat string representation documented above.booleanProvides 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 TypeMethodDescriptionvoidConvenience function that adds a collection of cells with the same label.private static voidS2ShapeIndexRegion.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 S2LaxPolylineShapeS2LaxPolylineShape.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 S2LaxPolygonShapeS2LaxPolygonShape.createSnapped(Iterable<? extends Iterable<S2CellId>> loops) AsS2LaxPolygonShape.create(com.google.common.geometry.S2Polygon), but packs vertices into a long[] array.static S2LaxPolylineShapeS2LaxPolylineShape.createSnapped(Iterable<S2CellId> vertices) AsS2LaxPolylineShape.create(com.google.common.geometry.S2Polyline), but with vertices at the center of cell IDs, packed into a long[].voidS2CellUnion.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.voidS2CellIdVectorCoder.encode(List<S2CellId> values, OutputStream output) private static voidGiven a region and a starting cell, return the set of all the edge-connected cells at the same level that intersect "region".voidS2CellId.getAllNeighbors(int nbrLevel, List<S2CellId> output) Append all neighbors of this cell at the given level to "output".voidS2ShapeIndexRegion.getCellUnionBound(List<S2CellId> cellIds) Clears the given list of cells and adds the cell union of this index.private intS2EdgeIndex.getCovering(S2Point a, S2Point b, boolean thickenEdge, ArrayList<S2CellId> edgeCovering) Computes a cell covering of an edge.voidS2RegionCoverer.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 voidS2EdgeIndex.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 voidS2EdgeIndex.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.voidS2RegionCoverer.getFastCovering(S2Cap cap, ArrayList<S2CellId> results) Like GetCovering(), except that this method is much faster and the coverings are not as tight.voidS2RegionCoverer.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 voidLike#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 voidS2RegionCoverer.getRawFastCovering(S2Cap cap, int maxCellsHint, List<S2CellId> covering) Compute a covering of the given cap.static voidS2RegionCoverer.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.voidS2CellId.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 intS2CellUnion.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.voidS2CellUnion.initFromCellIds(ArrayList<S2CellId> cellIds) Populates a cell union with the given S2CellIds, and then calls normalize().voidS2CellUnion.initRawCellIds(ArrayList<S2CellId> cellIds) Populates a cell union with the given S2CellIds.voidS2CellUnion.initRawSwap(List<S2CellId> cellIds) Like the initFrom*() constructors, but does not call normalize().voidPopulates a cell union with the given S2CellIds.static booleanLikeS2CellUnion.normalize(), but works directly with a vector of S2CellIds.voidS2RegionCoverer.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 S2CellIdModifierConstructorDescriptionprivateprivateprivate(package private)QueueEntry(S1ChordAngle distance, S2CellId id) privateAn 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) protectedS2Iterator(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) privateSimpleSnapped(Iterable<S2CellId> vertices)