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 interface
S2LaxPolygonShape
A region defined by a collection of zero or more closed loops.interface
S2LaxPolylineShape
S2LaxPolylineShape represents a polyline.static interface
S2ShapeAspect.EdgeAspect.Closed
Chains are closed, that is, there is an implicit edge between the ends of each chain.static interface
S2ShapeAspect.EdgeAspect.Open
Chains are open, that is, there is no implicit edge between the ends of each chain.static interface
S2ShapeAspect.Mixed
A full S2Shape that mixes together each aspect.Classes in com.google.common.geometry that implement S2Shape Modifier and Type Class Description class
S2Edge
An abstract directed edge from one S2Point to another S2Point.static class
S2LaxPolygonShape.MultiArray
A multi polygon with points referenced from an array.static class
S2LaxPolygonShape.MultiList
A multi polygon with vertices referenced from aList
, and cumulative edges referenced from anPrimitiveArrays.Longs
.static class
S2LaxPolygonShape.MultiPacked
A multi polygon with vertex coordinates stored in a double[].static class
S2LaxPolygonShape.MultiSnapped
A multi polygon with vertices at cell ID centers stored in a long[].static class
S2LaxPolygonShape.SimpleArray
A simple polygon with points referenced from an array.static class
S2LaxPolygonShape.SimpleList
A simple polygon with vertices referenced from aList
.static class
S2LaxPolygonShape.SimplePacked
A simple polygon with vertex coordinates stored in a double[].static class
S2LaxPolygonShape.SimpleSnapped
A simple polygon with vertices at cell ID centers stored in a long[].static class
S2LaxPolylineShape.MultiArray
A multi polyline storing references to previously allocated S2Point instances.static class
S2LaxPolylineShape.MultiPacked
A multi polyline storing xyz coordinates in a single packed 'double' array.static class
S2LaxPolylineShape.MultiSnapped
A multi polyline storing cell IDs in a single 'long' array.static class
S2LaxPolylineShape.SimpleArray
A polyline storing references to previously allocated S2Point instances.static class
S2LaxPolylineShape.SimpleList
A polyline storingS2Point
s in aList
.static class
S2LaxPolylineShape.SimplePacked
A polyline storing xyz coordinates in a single packed 'double' array.static class
S2LaxPolylineShape.SimpleSnapped
A polyline storing cell IDs in a single 'long' array.class
S2Loop
An S2Loop represents a simple spherical polygon.static class
S2Point.Shape
An S2Shape representing a list of S2Points.class
S2Polygon.Shape
Wrapper class for indexing a polygon viaS2ShapeIndex
.class
S2Polyline
An S2Polyline represents a sequence of zero or more vertices connected by straight edges (geodesics).static class
S2ShapeAspect.ChainAspect.Multi
A sequence of chains, represented as an array of the first 'edgeId' for each chain.(package private) static class
S2ShapeAspect.ChainAspect.Multi.Array
An array of S2Point references for multiple chains.(package private) static class
S2ShapeAspect.ChainAspect.Multi.Packed
Packed coordinates for multiple chains.(package private) static class
S2ShapeAspect.ChainAspect.Multi.Snapped
Snapped cell centers for multiple chains.static class
S2ShapeAspect.ChainAspect.Simple
A single non-empty chain.(package private) static class
S2ShapeAspect.ChainAspect.Simple.Array
A simple chain of S2Point references.(package private) static class
S2ShapeAspect.ChainAspect.Simple.Packed
A simple chain of packed coordinates.(package private) static class
S2ShapeAspect.ChainAspect.Simple.Snapped
A simple chain of packed cell centers.(package private) static class
S2ShapeUtil.S2EdgeVectorShape
S2EdgeVectorShape 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. cachedShapes
The array of not-yet-decoded and decoded shapes.private S2Shape
S2EdgeQuery.CrossingFilter. shape
private S2Shape
S2ShapeIndex.S2ClippedShape. shape
If positive, this is the shape ID and the shape does not contain the center of the cell.private static 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 S2Shape Modifier and Type Field Description private java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer>
S2TaggedShapeCoder.Builder. classToTypeTag
private java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer>
S2TaggedShapeCoder. classToTypeTag
static VectorCoder<S2Shape>
VectorCoder. COMPACT_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding.static VectorCoder<S2Shape>
VectorCoder. FAST_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding.private java.util.List<S2Shape>
S2ShapeIndex. pendingRemovals
The shapes that have been queued for removal but not processed yet (not yet used.)private static com.google.common.base.Predicate<S2Shape>
S2Polygon. REVERSE_HOLES
Returns true for S2Loops for whichS2Loop.isHole()
is true.private static com.google.common.base.Predicate<S2Shape>
S2Polygon. REVERSE_NONE
Returns false for all shapes.private com.google.common.base.Predicate<S2Shape>
S2Polygon.EdgeClipper. reverseEdges
protected java.util.List<S2Shape>
S2ShapeIndex. shapes
Shapes currently in the index.private java.util.List<S2Shape>
S2ShapeIndexCoder. shapes
private java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>>
S2TaggedShapeCoder.Builder. typeTagToCoder
private java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>>
S2TaggedShapeCoder. typeTagToCoder
Methods 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)
Associatesclazz
with a uniquecoder
andtypeTag
.(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 ofclazzes
with a uniquecoder
andtypeTag
.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 S2Shape
S2TaggedShapeCoder. decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
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 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 ofS2Shape
fromindex
to 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 void
S2ShapeIndex. add(S2Shape shape)
Adds the given shape to this index.void
S2ShapeIndexCoder.EncodedS2ShapeIndex. add(S2Shape shape)
private void
S2Polygon.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
.void
S2ShapeIndex.InteriorTracker. addShape(int shapeId, S2Shape shape)
Adds a shape whose interior should be tracked.static double
S2ShapeMeasures. area(S2Shape shape)
For shapes of dimension 2, returns the area of the shape on the unit sphere.static S2Point
S2ShapeMeasures. centroid(S2Shape shape)
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
S2ShapeIndex.S2ClippedShape.Contained. create(S2CellId cellId, S2Shape shape)
(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, java.util.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, java.util.List<S2ShapeIndex.ClippedEdge> edges, int start, int end)
(package private) static S2ShapeIndex.S2ClippedShape.OneEdge
S2ShapeIndex.S2ClippedShape.OneEdge. create(S2CellId cellId, S2Shape shape, boolean containsCenter, S2ShapeIndex.ClippedEdge clippedEdge)
void
S2TaggedShapeCoder. encode(S2Shape value, java.io.OutputStream output)
static boolean
S2ShapeUtil. 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.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.Edges
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.Edges
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 java.lang.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
S2ShapeUtil. indexOf(java.util.List<? extends S2Shape> shapes, S2Shape shape)
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
S2ShapeMeasures. length(S2Shape shape)
Returns the sum of all polyline lengths on the unit sphere for shapes of dimension 1, orS1Angle.ZERO
otherwise.(package private) static double
S2ShapeMeasures. loopArea(S2Shape shape, int chainId)
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
S2ShapeMeasures. perimeter(S2Shape shape)
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
S2ShapeIndex. remove(S2Shape shape)
Currently not implemented.void
S2ShapeIndexCoder.EncodedS2ShapeIndex. remove(S2Shape shape)
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
S2ContainsPointQuery.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 double
S2ShapeMeasures. 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 void
S2ShapeIndexCoder. encodeCell(S2ShapeIndex.Cell cell, com.google.common.collect.Multimap<S2Shape,java.lang.Integer> shapeIds, java.io.OutputStream output)
static boolean
S2ShapeUtil. 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 int
S2ShapeUtil. indexOf(java.util.List<? extends S2Shape> shapes, S2Shape shape)
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 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)
-