Uses of Class
com.google.common.geometry.S2CellId
-
-
Uses of S2CellId in com.google.common.geometry
Fields in com.google.common.geometry declared as S2CellId Modifier and Type Field Description static S2CellId[]S2CellId. FACE_CELLSMethods in com.google.common.geometry that return S2CellId Modifier and Type Method Description S2CellIdS2CellId. 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.S2CellIdS2CellId. 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).S2CellIdS2CellIndex.CellIterator. cellId()Returns the S2CellId of the current (cellId, label) pair.S2CellIdS2CellIndex.ContentsIterator. cellId()Returns the S2CellId of the current (cellId, label) pair.S2CellIdS2CellUnion. cellId(int i)Convenience methods for accessing the individual cell ids.S2CellIdS2CellId. child(int position)Returns the immediate child of this cell at the given traversal order position (in the range 0 to 3).S2CellIdS2CellId. childBegin()Returns the first child in a traversal of the children of this cell, in Hilbert curve order.S2CellIdS2CellId. childBegin(int level)Returns the first cell in a traversal of children a given level deeper than this cell, in Hilbert curve order.S2CellIdS2CellId. childEnd()Returns the first cell after a traversal of the children of this cell in Hilbert curve order.S2CellIdS2CellId. 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 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).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.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 S2CellIdS2CellId. fromPoint(S2Point p)Return the leaf cell containing the given point (a direction vector, not necessarily unit length).static S2CellIdS2CellId. fromToken(String token)Decodes the cell id from a compact text string suitable for display or indexing.S2CellIdS2Cell. id()S2CellIdS2Iterator. id()Returns the cell id for the current cell.S2CellIdS2PaddedCell. id()Returns the ID of this padded cell.S2CellIdS2ShapeIndex.RangeIterator. id()Returns the current S2CellId or cell contents.S2CellIdS2CellIndex.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.S2CellIdS2CellId. next()Return the next cell at the same level along the Hilbert curve.S2CellIdS2CellId. 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.S2CellIdS2CellId. parent()S2CellIdS2CellId. 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).S2CellIdS2CellId. prev()Return the previous cell at the same level along the Hilbert curve.S2CellIdS2CellId. prevWrap()Like prev(), but wraps around from the last face to the first and vice versa.S2CellIdS2CellId. rangeMax()Returns the end of the range of cell ids that are contained within this cell (including itself.) The range is *inclusive* (i.e.S2CellIdS2ShapeIndex.RangeIterator. rangeMax()S2CellIdS2CellId. rangeMin()Returns the start of the range of cell ids that are contained within this cell (including itself.) The range is *inclusive* (i.e.S2CellIdS2ShapeIndex.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.S2CellIdS2PaddedCell. shrinkToFit(R2Rect rect)Returns the smallest cell that contains all descendants of this cell whose bounds intersect "rect".S2CellIdS2CellIndex.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 ArrayList<S2CellId>S2CellUnion. cellIds()Direct access to the underlying vector for iteration .Iterable<S2CellId>S2CellId. children()Iterable<S2CellId>S2CellId. childrenAtLevel(int level)Iterator<S2CellId>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 voidS2CellIndex. add(S2CellId cellId, int label)Adds the given (cellId, label) pair to the index.intS2CellId. compareTo(S2CellId that)intS2Iterator. compareTo(S2CellId cellId)Returns the comparison from the current iterator cell to the given cell ID.booleanS2CellId. contains(S2CellId other)Return true if the given cell is contained within this one.booleanS2CellUnion. contains(S2CellId id)Return true if the cell union contains the given cell id.intS2CellId. getCommonAncestorLevel(S2CellId other)Returns the level of the "lowest common ancestor" of this cell and "other".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)voidS2CellUnion. 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)booleanS2CellId. lessThan(S2CellId x)S2ShapeIndex.CellRelationS2Iterator. locate(S2CellId target)Positions 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.voidS2CellIndex.NonEmptyRangeIterator. seek(S2CellId target)voidS2CellIndex.RangeIterator. seek(S2CellId target)Positions the iterator at the range containing "target".voidS2Iterator. 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.voidS2Iterator. seekForward(S2CellId target)Advances the iterator to the next cell with id() >= target.static StringS2TextFormat. toString(S2CellId cellId)Convert an S2CellId to the S2TextFormat string representation documented above.booleanS2CellIndex.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 voidS2CellIndex. add(Iterable<S2CellId> cellIds, int label)Convenience function that adds a collection of cells with the same label.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.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.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.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 voidS2CellUnion. 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 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".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().voidS2CellUnion. initSwap(List<S2CellId> cellIds)Populates a cell union with the given S2CellIds.static booleanS2CellUnion. normalize(List<S2CellId> ids)LikeS2CellUnion.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).Constructors in com.google.common.geometry with parameters of type S2CellId Constructor Description S2Cell(S2CellId id)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 Constructor Description 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).
-