Uses of Class
com.google.common.geometry.S2Polygon
-
Uses of S2Polygon in com.google.common.geometry
Fields in com.google.common.geometry declared as S2PolygonMethods in com.google.common.geometry that return S2PolygonModifier and TypeMethodDescriptionS2PolygonBuilder.assemblePolygon()
Convenience method for when you don't care about unused edges.static S2Polygon
S2Polygon.decode
(InputStream input) Decodes a polygon that was encoded usingencode(java.io.OutputStream)
.private static S2Polygon
S2Polygon.decodeCompressed
(LittleEndianInput decoder) private static S2Polygon
S2Polygon.decodeLossless
(LittleEndianInput decoder) private static S2Polygon
S2TextFormat.internalMakePolygon
(String str, boolean normalizeLoops) static S2Polygon
S2TextFormat.makePolygon
(String str) As above, but does not CHECK-fail on invalid input.static S2Polygon
S2TextFormat.makePolygonOrDie
(String str) Given a sequence of loops separated by semicolons, returns a newly allocated polygon.static S2Polygon
S2TextFormat.makeVerbatimPolygon
(String str) As above, but does not CHECK-fail on invalid input.static S2Polygon
S2TextFormat.makeVerbatimPolygonOrDie
(String str) Like MakePolygon(), except that it does not normalize loops (i.e., it gives you exactly what you asked for).S2Polygon.Shape.polygon()
static S2Polygon
Returns a polygon that is the union of the given polygons.static S2Polygon
S2Polygon.unionSloppy
(Iterable<S2Polygon> polygons, S1Angle vertexMergeRadius) Returns a polygon that is the union of the given polygons; combines vertices that form edges that are almost identical, as defined byvertexMergeRadius
.Methods in com.google.common.geometry with parameters of type S2PolygonModifier and TypeMethodDescriptionvoid
S2ConvexHullQuery.addPolygon
(S2Polygon polygon) Adds a polygon to the input geometry.void
S2PolygonBuilder.addPolygon
(S2Polygon polygon) Add all loops in the given polygon.boolean
S2Polygon.approxContains
(S2Polygon b, S1Angle vertexMergeRadius) Returns true if this polygon (A) approximately contains the given other polygon (B).boolean
S2PolygonBuilder.assemblePolygon
(S2Polygon polygon, List<S2Edge> unusedEdges) Like AssembleLoops, but then assembles the loops into a polygon.(package private) boolean
S2Polygon.boundaryApproxEquals
(S2Polygon b, double maxError) Returns true if two polygons have the same boundary, except for vertex perturbations.(package private) boolean
S2Polygon.boundaryNear
(S2Polygon b, double maxError) Returns true if two polygons have boundaries that are withinmaxError
of each other along their entire lengths.private static void
S2Polygon.clipBoundary
(S2Polygon a, boolean reverseA, S2Polygon b, boolean invertB, boolean addSharedEdges, S2PolygonBuilder builder) Clips the boundary of A to the interior of B, and adds the resulting edges tobuilder
.int
Comparator (needed by Comparable interface).boolean
Returns true if this polygon contains the given other polygon, i.e., if polygon A contains all points contained by polygon B.private boolean
S2Polygon.containsBoundary
(S2Polygon b) Returns true if this polygon (A) contains the entire boundary of B.(package private) void
Initializes this polygon to a copy of the given polygon.static S2LaxPolygonShape
Creates a polygon from the givenS2Polygon
by copying its data.private boolean
S2Polygon.excludesBoundary
(S2Polygon b) Returns true if this polygon (A) excludes the entire boundary of B.private boolean
S2Polygon.excludesNonCrossingComplementShells
(S2Polygon b) Given two polygons A and B such that the boundary of A does not cross any loop of B, returns true if A excludes all shell boundaries of the complement of B.private boolean
S2Polygon.excludesNonCrossingShells
(S2Polygon b) Given two polygons A and B such that the boundary of A does not cross any loop of B, returns true if A excludes all shell boundaries of B.static double
S2Polygon.getOverlapFraction
(S2Polygon a, S2Polygon b) Returns the overlap fraction of polygon b on polygon a, i.e.private static int[]
S2Polygon.S2PolygonIndex.getVertices
(S2Polygon poly) Returns number of vertices per loop.void
S2Polygon.initToComplement
(S2Polygon a) Initializes this polygon to the complement of the given polygon.void
S2Polygon.initToDifference
(S2Polygon a, S2Polygon b) void
S2Polygon.initToDifferenceSloppy
(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) void
S2Polygon.initToIntersection
(S2Polygon a, S2Polygon b) Initializes this polygon to the intersection, union, or difference (A - B) of the given two polygons.void
S2Polygon.initToIntersectionSloppy
(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) void
S2Polygon.initToSimplified
(S2Polygon a, S1Angle tolerance, boolean snapToCellCenters) Initializes this polygon to a polygon that contains fewer vertices and is within tolerance of the polygon a, with some caveats.void
S2Polygon.initToSimplifiedInCell
(S2Polygon a, S2Cell cell, S1Angle tolerance) Initializes this polygon to a polygon that contains fewer vertices and is within tolerance of the polygon a, while ensuring that the vertices on the cell boundary are preserved.private void
S2Polygon.initToSimplifiedInternal
(S2Polygon a, S1Angle tolerance, boolean snapToCellCenters, com.google.common.base.Predicate<S2Point> vertexFilter) Simplifies the polygon.void
S2Polygon.initToSnapped
(S2Polygon a, int snapLevel) Use S2PolygonBuilder to build this polygon by assembling the edges of a given polygon after snapping its vertices to the center of leaf cells.void
S2Polygon.initToUnion
(S2Polygon a, S2Polygon b) void
S2Polygon.initToUnionSloppy
(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) boolean
S2Polygon.intersects
(S2Polygon b) Returns true if this polygon intersects the given other polygon, i.e., if there is a point that is contained by both polygons.static String
Convert an S2Polygon to the S2TextFormat string representation documented above.static String
Convert an S2 polygon to the S2TextFormat string representation documented above, using the given loopSeparator between each loop.Method parameters in com.google.common.geometry with type arguments of type S2PolygonModifier and TypeMethodDescriptionstatic S2Polygon
Returns a polygon that is the union of the given polygons.static S2Polygon
S2Polygon.unionSloppy
(Iterable<S2Polygon> polygons, S1Angle vertexMergeRadius) Returns a polygon that is the union of the given polygons; combines vertices that form edges that are almost identical, as defined byvertexMergeRadius
.Constructors in com.google.common.geometry with parameters of type S2PolygonModifierConstructorDescriptionCopy constructor.S2PolygonIndex
(S2Polygon poly) (package private)
S2PolygonIndex
(S2Polygon poly, boolean reverse)