Uses of Interface
com.google.common.geometry.S2Shape
-
Uses of S2Shape in com.google.common.geometry
Subinterfaces of S2Shape in com.google.common.geometryModifier and TypeInterfaceDescriptioninterface
A region defined by a collection of zero or more closed loops.interface
S2LaxPolylineShape represents a polyline.static interface
Chains are closed, that is, there is an implicit edge between the ends of each chain.static interface
Chains are open, that is, there is no implicit edge between the ends of each chain.static interface
A full S2Shape that mixes together each aspect.Classes in com.google.common.geometry that implement S2ShapeModifier and TypeClassDescriptionfinal class
An abstract directed edge from one S2Point to another S2Point.static class
A multi polygon with points referenced from an array.static class
A multi polygon with vertices referenced from aList<S2Point>
, and cumulative edges referenced from anPrimitiveArrays.Longs
.static class
A multi polygon with vertex coordinates stored in a double[].static class
A multi polygon with vertices at cell ID centers stored in a long[].static class
A simple polygon with points referenced from an array.static class
static class
A simple polygon with vertex coordinates stored in a double[].static class
A simple polygon with vertices at cell ID centers stored in a long[].static class
A multi polyline storing references to previously allocated S2Point instances.static class
A multi polyline storing xyz coordinates in a single packed 'double' array.static class
A multi polyline storing cell IDs in a single 'long' array.static class
A polyline storing references to previously allocated S2Point instances.static class
static class
A polyline storing xyz coordinates in a single packed 'double' array.static class
A polyline storing cell IDs in a single 'long' array.final class
An S2Loop represents a simple spherical polygon.static class
An S2Shape representing a list of S2Points.class
Wrapper class for indexing a polygon viaS2ShapeIndex
.final class
An S2Polyline represents a sequence of zero or more vertices connected by straight edges (geodesics).static class
A sequence of chains, represented as an array of the first 'edgeId' for each chain.(package private) static class
An array of S2Point references for multiple chains.(package private) static class
Packed coordinates for multiple chains.(package private) static class
Snapped cell centers for multiple chains.static class
A single non-empty chain.(package private) static class
A simple chain of S2Point references.(package private) static class
A simple chain of packed coordinates.(package private) static class
A simple chain of packed cell centers.(package private) static class
S2EdgeVectorShape is an S2Shape representing a set of unrelated edges.Fields in com.google.common.geometry declared as S2ShapeModifier and TypeFieldDescriptionprivate final S2Shape[]
S2ShapeIndexCoder.EncodedS2ShapeIndex.cachedShapes
The array of not-yet-decoded and decoded shapes.private final S2Shape
S2EdgeQuery.CrossingFilter.shape
private final S2Shape
S2ShapeIndex.S2ClippedShape.shape
If positive, this is the shape ID and the shape does not contain the center of the cell.private static final S2Shape
S2ShapeIndexCoder.EncodedS2ShapeIndex.UNDECODED_SHAPE
Internal representation of an undecoded shape, which must be distinguished from a null shape.Fields in com.google.common.geometry with type parameters of type S2ShapeModifier and TypeFieldDescriptionprivate final IdentityHashMap
<Class<? extends S2Shape>, Integer> S2TaggedShapeCoder.Builder.classToTypeTag
private final IdentityHashMap
<Class<? extends S2Shape>, Integer> S2TaggedShapeCoder.classToTypeTag
static final VectorCoder
<S2Shape> VectorCoder.COMPACT_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding.static final VectorCoder
<S2Shape> VectorCoder.FAST_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding.S2ShapeIndex.pendingRemovals
The shapes that have been queued for removal but not processed yet (not yet used.)private static final com.google.common.base.Predicate
<S2Shape> S2Polygon.REVERSE_HOLES
Returns true for S2Loops for whichS2Loop.isHole()
is true.private static final com.google.common.base.Predicate
<S2Shape> S2Polygon.REVERSE_NONE
Returns false for all shapes.private final com.google.common.base.Predicate
<S2Shape> S2Polygon.EdgeClipper.reverseEdges
S2ShapeIndex.shapes
Shapes currently in the index.S2ShapeIndexCoder.shapes
S2TaggedShapeCoder.Builder.typeTagToCoder
S2TaggedShapeCoder.typeTagToCoder
Methods in com.google.common.geometry with type parameters of type S2ShapeModifier and TypeMethodDescription(package private) <T extends S2Shape>
S2TaggedShapeCoder.BuilderAssociatesclazz
with a uniquecoder
andtypeTag
.(package private) <T extends S2Shape>
S2TaggedShapeCoder.BuilderSame asS2TaggedShapeCoder.Builder.add(Class, S2Coder, int)
, but associates all elements ofclazzes
with a uniquecoder
andtypeTag
.private <T extends S2Shape>
voidS2TaggedShapeCoder.Builder.validateClass
(Class<? extends T> clazz) Methods in com.google.common.geometry that return S2ShapeModifier and TypeMethodDescriptionS2TaggedShapeCoder.decode
(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor) final S2Shape
S2ShapeIndex.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 S2ShapeModifier and TypeMethodDescriptionS2EdgeQuery.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.S2ContainsPointQuery.getContainingShapes
(S2Point p) A convenience function that returns all the shapes that containp
.S2EdgeQuery.getCrossings
(S2Point a, S2Point b) Returns edges for each shape that either crosses AB or shares a vertex with AB.S2ShapeIndex.getShapes()
Returns an immutable list view of shapes in the index.S2ShapeUtil.shapeToShapeId
(S2ShapeIndex index) Returns a multimap ofS2Shape
fromindex
to the shape's ID (i.e., its position withinindex.shapes
).Methods in com.google.common.geometry with parameters of type S2ShapeModifier and TypeMethodDescriptionvoid
Adds the given shape to this index.void
private void
S2Polygon.EdgeClipper.addIntersection
(S2Point a0, S2Point a1, S2Point b0, S2Point b1, S2Shape bShape, int crossing, 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
.void
Adds a shape whose interior should be tracked.static double
For shapes of dimension 2, returns the area of the shape on the unit sphere.static S2Point
Returns the centroid of shape multiplied by the measure of shape.static boolean
S2ShapeUtil.containsBruteForce
(S2Shape shape, S2Point point) Returns true if the given shape contains the given point.(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
S2TaggedShapeCoder.encode
(S2Shape value, OutputStream output) static boolean
Returns true if all methods of the two S2Shapes return identical results, except for id() and typeTag().(package private) S2ShapeIndex.S2ClippedShape
S2ShapeIndex.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 void
S2ShapeMeasures.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.getCandidates
(S2Point a, S2Point b, S2Shape shape) Given a query edge AB and a shapeshape
, returns a superset of the edges ofshape
that intersect AB.S2EdgeQuery.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.ReferencePoint
S2ShapeUtil.getReferencePoint
(S2Shape shape) This is a helper function for implementing S2Shape.getReferencePoint().private static Boolean
S2ShapeUtil.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 int
Returns the index ofshape
inshapes
asList.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 S1Angle
Returns the sum of all polyline lengths on the unit sphere for shapes of dimension 1, orS1Angle.ZERO
otherwise.(package private) static double
Returns the area of the loop interior, i.e.(package private) static S2Point
S2ShapeMeasures.loopCentroid
(S2Shape shape, int chainId) Returns the true centroid of the loop multiplied by the area of the loop.(package private) static S1Angle
S2ShapeMeasures.loopPerimeter
(S2Shape shape, int chainId) Returns the perimeter of the loop, orS1Angle.ZERO
if the loop has 0 or 1 vertices.static S1Angle
Returns the sum of all loop perimeters on the unit sphere for shapes of dimension 2, orS1Angle.ZERO
otherwise.(package private) static S2Point
S2ShapeMeasures.polylineCentroid
(S2Shape shape, int chainId) Returns the true centroid of the polyline multiplied by the length of the polyline.(package private) static S1Angle
S2ShapeMeasures.polylineLength
(S2Shape shape, int chainId) Returns the length of the polyline, orS1Angle.ZERO
if the polyline has fewer than two vertices.void
Currently not implemented.void
boolean
S2ContainsPointQuery.shapeContains
(S2Shape shape, S2Point p) Returns true if the given shape containsp
under the specifiedS2ContainsPointQuery.S2VertexModel
.private static double
S2ShapeMeasures.signedLoopArea
(S2Shape shape, int chainId) Returns the area of the loop interior, i.e.boolean
Returns true if the next edge should be received, or false to terminate early.(package private) static double
S2ShapeMeasures.turningAngle
(S2Shape shape, int chainId) Method parameters in com.google.common.geometry with type arguments of type S2ShapeModifier and TypeMethodDescriptionprivate static S2ShapeIndex.S2ClippedShape[]
S2ShapeIndexCoder.decodeClippedShapes
(List<S2Shape> shapes, PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor) private static void
S2ShapeIndexCoder.encodeCell
(S2ShapeIndex.Cell cell, com.google.common.collect.Multimap<S2Shape, Integer> shapeIds, OutputStream output) static boolean
Returns true if the lists 'a' and 'b' have identical shapes according toS2ShapeUtil.equals(S2Shape, S2Shape)
.(package private) static int
Returns the index ofshape
inshapes
asList.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 S2ShapeModifierConstructorDescriptionprivate
(package private)
CrossingFilter
(S2Shape shape, S2EdgeQuery.Edges edges, S2Point a0, S2Point a1) private
private
private
ManyEdges
(S2Shape shape, List<S2ShapeIndex.ClippedEdge> edges, int start, int end) private
OneEdge
(S2Shape shape, S2ShapeIndex.ClippedEdge clippedEdge) private
S2ClippedShape
(S2Shape shape) Constructor parameters in com.google.common.geometry with type arguments of type S2ShapeModifierConstructorDescriptionprivate
Builder
(IdentityHashMap<Class<? extends S2Shape>, Integer> classToTypeTag, Map<Integer, S2Coder<? extends S2Shape>> typeTagToCoder) private
Builder
(IdentityHashMap<Class<? extends S2Shape>, Integer> classToTypeTag, Map<Integer, S2Coder<? extends S2Shape>> typeTagToCoder) EdgeClipper
(S2ShapeIndex index, boolean addSharedEdges, com.google.common.base.Predicate<S2Shape> reverseEdges) Initialize an EdgeClipper for the given S2ShapeIndex.(package private)
EncodedS2ShapeIndex
(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor, List<S2Shape> shapeFactory) S2ShapeIndexCoder
(List<S2Shape> shapes) Constructs aS2ShapeIndexCoder
.private
S2TaggedShapeCoder
(IdentityHashMap<Class<? extends S2Shape>, Integer> classToTypeTag, Map<Integer, S2Coder<? extends S2Shape>> typeTagToCoder) private
S2TaggedShapeCoder
(IdentityHashMap<Class<? extends S2Shape>, Integer> classToTypeTag, Map<Integer, S2Coder<? extends S2Shape>> typeTagToCoder)