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 S2PolygonS2Polygon.decode(InputStream input) Decodes a polygon that was encoded usingencode(java.io.OutputStream).private static S2PolygonS2Polygon.decodeCompressed(LittleEndianInput decoder) private static S2PolygonS2Polygon.decodeLossless(LittleEndianInput decoder) private static S2PolygonS2TextFormat.internalMakePolygon(String str, boolean normalizeLoops) static S2PolygonS2TextFormat.makePolygon(String str) As above, but does not CHECK-fail on invalid input.static S2PolygonS2TextFormat.makePolygonOrDie(String str) Given a sequence of loops separated by semicolons, returns a newly allocated polygon.static S2PolygonS2TextFormat.makeVerbatimPolygon(String str) As above, but does not CHECK-fail on invalid input.static S2PolygonS2TextFormat.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 S2PolygonReturns a polygon that is the union of the given polygons.static S2PolygonS2Polygon.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 TypeMethodDescriptionvoidS2ConvexHullQuery.addPolygon(S2Polygon polygon) Adds a polygon to the input geometry.voidS2PolygonBuilder.addPolygon(S2Polygon polygon) Add all loops in the given polygon.booleanS2Polygon.approxContains(S2Polygon b, S1Angle vertexMergeRadius) Returns true if this polygon (A) approximately contains the given other polygon (B).booleanS2PolygonBuilder.assemblePolygon(S2Polygon polygon, List<S2Edge> unusedEdges) Like AssembleLoops, but then assembles the loops into a polygon.(package private) booleanS2Polygon.boundaryApproxEquals(S2Polygon b, double maxError) Returns true if two polygons have the same boundary, except for vertex perturbations.(package private) booleanS2Polygon.boundaryNear(S2Polygon b, double maxError) Returns true if two polygons have boundaries that are withinmaxErrorof each other along their entire lengths.private static voidS2Polygon.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.intComparator (needed by Comparable interface).booleanReturns true if this polygon contains the given other polygon, i.e., if polygon A contains all points contained by polygon B.private booleanS2Polygon.containsBoundary(S2Polygon b) Returns true if this polygon (A) contains the entire boundary of B.(package private) voidInitializes this polygon to a copy of the given polygon.static S2LaxPolygonShapeCreates a polygon from the givenS2Polygonby copying its data.private booleanS2Polygon.excludesBoundary(S2Polygon b) Returns true if this polygon (A) excludes the entire boundary of B.private booleanS2Polygon.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 booleanS2Polygon.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 doubleS2Polygon.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.voidS2Polygon.initToComplement(S2Polygon a) Initializes this polygon to the complement of the given polygon.voidS2Polygon.initToDifference(S2Polygon a, S2Polygon b) voidS2Polygon.initToDifferenceSloppy(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) voidS2Polygon.initToIntersection(S2Polygon a, S2Polygon b) Initializes this polygon to the intersection, union, or difference (A - B) of the given two polygons.voidS2Polygon.initToIntersectionSloppy(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) voidS2Polygon.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.voidS2Polygon.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 voidS2Polygon.initToSimplifiedInternal(S2Polygon a, S1Angle tolerance, boolean snapToCellCenters, com.google.common.base.Predicate<S2Point> vertexFilter) Simplifies the polygon.voidS2Polygon.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.voidS2Polygon.initToUnion(S2Polygon a, S2Polygon b) voidS2Polygon.initToUnionSloppy(S2Polygon a, S2Polygon b, S1Angle vertexMergeRadius) booleanS2Polygon.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 StringConvert an S2Polygon to the S2TextFormat string representation documented above.static StringConvert 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 S2PolygonReturns a polygon that is the union of the given polygons.static S2PolygonS2Polygon.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)