Uses of Interface
com.google.common.geometry.S2Shape
-
-
Uses of S2Shape in com.google.common.geometry
Subinterfaces of S2Shape in com.google.common.geometry Modifier and Type Interface Description interfaceS2LaxPolygonShapeA region defined by a collection of zero or more closed loops.interfaceS2LaxPolylineShapeS2LaxPolylineShape represents a polyline.static interfaceS2ShapeAspect.EdgeAspect.ClosedChains are closed, that is, there is an implicit edge between the ends of each chain.static interfaceS2ShapeAspect.EdgeAspect.OpenChains are open, that is, there is no implicit edge between the ends of each chain.static interfaceS2ShapeAspect.MixedA full S2Shape that mixes together each aspect.Classes in com.google.common.geometry that implement S2Shape Modifier and Type Class Description classS2EdgeAn abstract directed edge from one S2Point to another S2Point.static classS2LaxPolygonShape.MultiArrayA multi polygon with points referenced from an array.static classS2LaxPolygonShape.MultiListA multi polygon with vertices referenced from aList, and cumulative edges referenced from anPrimitiveArrays.Longs.static classS2LaxPolygonShape.MultiPackedA multi polygon with vertex coordinates stored in a double[].static classS2LaxPolygonShape.MultiSnappedA multi polygon with vertices at cell ID centers stored in a long[].static classS2LaxPolygonShape.SimpleArrayA simple polygon with points referenced from an array.static classS2LaxPolygonShape.SimpleListA simple polygon with vertices referenced from aList.static classS2LaxPolygonShape.SimplePackedA simple polygon with vertex coordinates stored in a double[].static classS2LaxPolygonShape.SimpleSnappedA simple polygon with vertices at cell ID centers stored in a long[].static classS2LaxPolylineShape.MultiArrayA multi polyline storing references to previously allocated S2Point instances.static classS2LaxPolylineShape.MultiPackedA multi polyline storing xyz coordinates in a single packed 'double' array.static classS2LaxPolylineShape.MultiSnappedA multi polyline storing cell IDs in a single 'long' array.static classS2LaxPolylineShape.SimpleArrayA polyline storing references to previously allocated S2Point instances.static classS2LaxPolylineShape.SimpleListA polyline storingS2Points in aList.static classS2LaxPolylineShape.SimplePackedA polyline storing xyz coordinates in a single packed 'double' array.static classS2LaxPolylineShape.SimpleSnappedA polyline storing cell IDs in a single 'long' array.classS2LoopAn S2Loop represents a simple spherical polygon.static classS2Point.ShapeAn S2Shape representing a list of S2Points.classS2Polygon.ShapeWrapper class for indexing a polygon viaS2ShapeIndex.classS2PolylineAn S2Polyline represents a sequence of zero or more vertices connected by straight edges (geodesics).static classS2ShapeAspect.ChainAspect.MultiA sequence of chains, represented as an array of the first 'edgeId' for each chain.(package private) static classS2ShapeAspect.ChainAspect.Multi.ArrayAn array of S2Point references for multiple chains.(package private) static classS2ShapeAspect.ChainAspect.Multi.PackedPacked coordinates for multiple chains.(package private) static classS2ShapeAspect.ChainAspect.Multi.SnappedSnapped cell centers for multiple chains.static classS2ShapeAspect.ChainAspect.SimpleA single non-empty chain.(package private) static classS2ShapeAspect.ChainAspect.Simple.ArrayA simple chain of S2Point references.(package private) static classS2ShapeAspect.ChainAspect.Simple.PackedA simple chain of packed coordinates.(package private) static classS2ShapeAspect.ChainAspect.Simple.SnappedA simple chain of packed cell centers.(package private) static classS2ShapeUtil.S2EdgeVectorShapeS2EdgeVectorShape is an S2Shape representing a set of unrelated edges.Fields in com.google.common.geometry declared as S2Shape Modifier and Type Field Description private S2Shape[]S2ShapeIndexCoder.EncodedS2ShapeIndex. cachedShapesThe array of not-yet-decoded and decoded shapes.private S2ShapeS2EdgeQuery.CrossingFilter. shapeprivate S2ShapeS2ShapeIndex.S2ClippedShape. shapeIf positive, this is the shape ID and the shape does not contain the center of the cell.private static S2ShapeS2ShapeIndexCoder.EncodedS2ShapeIndex. UNDECODED_SHAPEInternal representation of an undecoded shape, which must be distinguished from a null shape.Fields in com.google.common.geometry with type parameters of type S2Shape Modifier and Type Field Description private java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer>S2TaggedShapeCoder.Builder. classToTypeTagprivate java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer>S2TaggedShapeCoder. classToTypeTagstatic VectorCoder<S2Shape>VectorCoder. COMPACT_SHAPEAn encoder/decoder ofS2Shapes, where the shapes use theS2TaggedShapeCoder.COMPACTencoding.static VectorCoder<S2Shape>VectorCoder. FAST_SHAPEAn encoder/decoder ofS2Shapes, where the shapes use theS2TaggedShapeCoder.FASTencoding.private java.util.List<S2Shape>S2ShapeIndex. pendingRemovalsThe shapes that have been queued for removal but not processed yet (not yet used.)private static com.google.common.base.Predicate<S2Shape>S2Polygon. REVERSE_HOLESReturns true for S2Loops for whichS2Loop.isHole()is true.private static com.google.common.base.Predicate<S2Shape>S2Polygon. REVERSE_NONEReturns false for all shapes.private com.google.common.base.Predicate<S2Shape>S2Polygon.EdgeClipper. reverseEdgesprotected java.util.List<S2Shape>S2ShapeIndex. shapesShapes currently in the index.private java.util.List<S2Shape>S2ShapeIndexCoder. shapesprivate java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>>S2TaggedShapeCoder.Builder. typeTagToCoderprivate java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>>S2TaggedShapeCoder. typeTagToCoderMethods in com.google.common.geometry with type parameters of type S2Shape Modifier and Type Method Description (package private) <T extends S2Shape>
S2TaggedShapeCoder.BuilderS2TaggedShapeCoder.Builder. add(java.lang.Class<? extends T> clazz, S2Coder<T> coder, int typeTag)Associatesclazzwith a uniquecoderandtypeTag.(package private) <T extends S2Shape>
S2TaggedShapeCoder.BuilderS2TaggedShapeCoder.Builder. add(java.util.List<java.lang.Class<? extends T>> clazzes, S2Coder<T> coder, int typeTag)Same asS2TaggedShapeCoder.Builder.add(Class, S2Coder, int), but associates all elements ofclazzeswith a uniquecoderandtypeTag.private <T extends S2Shape>
voidS2TaggedShapeCoder.Builder. validateClass(java.lang.Class<? extends T> clazz)Methods in com.google.common.geometry that return S2Shape Modifier and Type Method Description S2ShapeS2TaggedShapeCoder. decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)S2ShapeS2ShapeIndex.S2ClippedShape. shape()Returns the original shape this clipped shape was clipped from.Methods in com.google.common.geometry that return types with arguments of type S2Shape Modifier and Type Method Description java.util.Map<S2Shape,S2EdgeQuery.Edges>S2EdgeQuery. getCandidates(S2Point a, S2Point b)Given a query edge AB, returns a map from the indexed shapes to a superset of the edges for each shape that intersect AB.java.lang.Iterable<S2Shape>S2ContainsPointQuery. getContainingShapes(S2Point p)A convenience function that returns all the shapes that containp.java.util.Map<S2Shape,S2EdgeQuery.Edges>S2EdgeQuery. getCrossings(S2Point a, S2Point b)Returns edges for each shape that either crosses AB or shares a vertex with AB.java.util.List<S2Shape>S2ShapeIndex. getShapes()Returns an immutable list view of shapes in the index.(package private) static com.google.common.collect.Multimap<S2Shape,java.lang.Integer>S2ShapeUtil. shapeToShapeId(S2ShapeIndex index)Returns a multimap ofS2Shapefromindexto the shape's ID (i.e., its position withinindex.shapes).Methods in com.google.common.geometry with parameters of type S2Shape Modifier and Type Method Description voidS2ShapeIndex. add(S2Shape shape)Adds the given shape to this index.voidS2ShapeIndexCoder.EncodedS2ShapeIndex. add(S2Shape shape)private voidS2Polygon.EdgeClipper. addIntersection(S2Point a0, S2Point a1, S2Point b0, S2Point b1, S2Shape bShape, int crossing, java.util.List<ParametrizedS2Point> intersections)Given two edges A and B such that robustCrossing(A, B) >= 0, determines if they intersect and adds any intersection point tointersections.voidS2ShapeIndex.InteriorTracker. addShape(int shapeId, S2Shape shape)Adds a shape whose interior should be tracked.static doubleS2ShapeMeasures. area(S2Shape shape)For shapes of dimension 2, returns the area of the shape on the unit sphere.static S2PointS2ShapeMeasures. centroid(S2Shape shape)Returns the centroid of shape multiplied by the measure of shape.static booleanS2ShapeUtil. containsBruteForce(S2Shape shape, S2Point point)Returns true if the given shape contains the given point.(package private) static S2ShapeIndex.S2ClippedShape.ContainedS2ShapeIndex.S2ClippedShape.Contained. create(S2CellId cellId, S2Shape shape)(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, java.util.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, java.util.List<S2ShapeIndex.ClippedEdge> edges, int start, int end)(package private) static S2ShapeIndex.S2ClippedShape.OneEdgeS2ShapeIndex.S2ClippedShape.OneEdge. create(S2CellId cellId, S2Shape shape, boolean containsCenter, S2ShapeIndex.ClippedEdge clippedEdge)voidS2TaggedShapeCoder. encode(S2Shape value, java.io.OutputStream output)static booleanS2ShapeUtil. equals(S2Shape a, S2Shape b)Returns true if all methods of the two S2Shapes return identical results, except for id() and typeTag().(package private) S2ShapeIndex.S2ClippedShapeS2ShapeIndex.Cell. findClipped(S2Shape shape)Returns the clipped shape corresponding to the given shape ID, or null if the shape does not intersect this cell.private static voidS2ShapeMeasures. forEachChainEdge(S2Shape shape, int chainId, S2ShapeMeasures.BiConsumer<S2Point,S2Point> edgeConsumer)Passes each edge (a, b) in the chain of shape at index chainId to edgeConsumer.S2EdgeQuery.EdgesS2EdgeQuery. getCandidates(S2Point a, S2Point b, S2Shape shape)Given a query edge AB and a shapeshape, returns a superset of the edges ofshapethat intersect AB.S2EdgeQuery.EdgesS2EdgeQuery. getCrossings(S2Point a, S2Point b, S2Shape shape)Returns edges from a given shape that either cross AB or share a vertex with AB.static S2Shape.ReferencePointS2ShapeUtil. getReferencePoint(S2Shape shape)This is a helper function for implementing S2Shape.getReferencePoint().private static java.lang.BooleanS2ShapeUtil. getReferencePointAtVertex(S2Shape shape, S2Point vtest)Returns null if 'vtest' is balanced (see definition above), otherwise 'vtest' is unbalanced and the return value indicates whether it is contained by 'shape'.(package private) static intS2ShapeUtil. indexOf(java.util.List<? extends S2Shape> shapes, S2Shape shape)Returns the index ofshapeinshapesasList.indexOf(Object), but using identity instead of equality to honor the semantics of S2ShapeIndex (where adding two S2Loops that are equal but not the same instance is treated as adding two separate shapes, with distinct shape IDs.)static S1AngleS2ShapeMeasures. length(S2Shape shape)Returns the sum of all polyline lengths on the unit sphere for shapes of dimension 1, orS1Angle.ZEROotherwise.(package private) static doubleS2ShapeMeasures. loopArea(S2Shape shape, int chainId)Returns the area of the loop interior, i.e.(package private) static S2PointS2ShapeMeasures. loopCentroid(S2Shape shape, int chainId)Returns the true centroid of the loop multiplied by the area of the loop.(package private) static S1AngleS2ShapeMeasures. loopPerimeter(S2Shape shape, int chainId)Returns the perimeter of the loop, orS1Angle.ZEROif the loop has 0 or 1 vertices.static S1AngleS2ShapeMeasures. perimeter(S2Shape shape)Returns the sum of all loop perimeters on the unit sphere for shapes of dimension 2, orS1Angle.ZEROotherwise.(package private) static S2PointS2ShapeMeasures. polylineCentroid(S2Shape shape, int chainId)Returns the true centroid of the polyline multiplied by the length of the polyline.(package private) static S1AngleS2ShapeMeasures. polylineLength(S2Shape shape, int chainId)Returns the length of the polyline, orS1Angle.ZEROif the polyline has fewer than two vertices.voidS2ShapeIndex. remove(S2Shape shape)Currently not implemented.voidS2ShapeIndexCoder.EncodedS2ShapeIndex. remove(S2Shape shape)booleanS2ContainsPointQuery. shapeContains(S2Shape shape, S2Point p)Returns true if the given shape containspunder the specifiedS2ContainsPointQuery.S2VertexModel.private static doubleS2ShapeMeasures. signedLoopArea(S2Shape shape, int chainId)Returns the area of the loop interior, i.e.booleanS2ContainsPointQuery.EdgeVisitor. test(S2Shape shape, int edgeId, S2Point a, S2Point b)Returns true if the next edge should be received, or false to terminate early.(package private) static doubleS2ShapeMeasures. turningAngle(S2Shape shape, int chainId)private static java.util.List<S2Point>S2ShapeMeasures. vertices(S2Shape shape, int chainId)Method parameters in com.google.common.geometry with type arguments of type S2Shape Modifier and Type Method Description private static S2ShapeIndex.S2ClippedShape[]S2ShapeIndexCoder. decodeClippedShapes(java.util.List<S2Shape> shapes, PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)private static voidS2ShapeIndexCoder. encodeCell(S2ShapeIndex.Cell cell, com.google.common.collect.Multimap<S2Shape,java.lang.Integer> shapeIds, java.io.OutputStream output)static booleanS2ShapeUtil. equals(java.util.List<S2Shape> a, java.util.List<S2Shape> b)Returns true if the lists 'a' and 'b' have identical shapes according toS2ShapeUtil.equals(S2Shape, S2Shape).(package private) static intS2ShapeUtil. indexOf(java.util.List<? extends S2Shape> shapes, S2Shape shape)Returns the index ofshapeinshapesasList.indexOf(Object), but using identity instead of equality to honor the semantics of S2ShapeIndex (where adding two S2Loops that are equal but not the same instance is treated as adding two separate shapes, with distinct shape IDs.)Constructors in com.google.common.geometry with parameters of type S2Shape Constructor Description Contained(S2Shape shape)CrossingFilter(S2Shape shape, S2EdgeQuery.Edges edges, S2Point a0, S2Point a1)EdgeRange(S2Shape shape, int offset, int count)ManyEdges(S2Shape shape, int[] edges)ManyEdges(S2Shape shape, java.util.List<S2ShapeIndex.ClippedEdge> edges, int start, int end)OneEdge(S2Shape shape, S2ShapeIndex.ClippedEdge clippedEdge)S2ClippedShape(S2Shape shape)Constructor parameters in com.google.common.geometry with type arguments of type S2Shape Constructor Description Builder(java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag, java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>> typeTagToCoder)Builder(java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag, java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>> typeTagToCoder)EdgeClipper(S2ShapeIndex index, boolean addSharedEdges, com.google.common.base.Predicate<S2Shape> reverseEdges)Initialize an EdgeClipper for the given S2ShapeIndex.EncodedS2ShapeIndex(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor, java.util.List<S2Shape> shapeFactory)S2ShapeIndexCoder(java.util.List<S2Shape> shapes)Constructs aS2ShapeIndexCoder.S2TaggedShapeCoder(java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag, java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>> typeTagToCoder)S2TaggedShapeCoder(java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag, java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>> typeTagToCoder)
-