Uses of Class
com.google.common.geometry.S2Polygon
-
Uses of S2Polygon in com.google.common.geometry
Classes in com.google.common.geometry that implement interfaces with type arguments of type S2PolygonModifier and TypeClassDescriptionfinal classAn S2Polygon is an S2Region object that represents a polygon.Methods 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 usingS2Polygon.encode(OutputStream).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.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.static S2LaxPolygonShapeCreates a polygon from the givenS2Polygonby copying its data.static doubleS2Polygon.getOverlapFraction(S2Polygon a, S2Polygon b) Returns the overlap fraction of polygon b on polygon a, i.e. the ratio of area of intersection to the area of polygon a.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.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 S2Polygon