We start at the given edge and assemble a loop taking left turns whenever possible.
(package private) static S2Loop
Returns a loop decoded from the given stream.
(package private) static S2Loop
Returns a new loop with one vertex that defines an empty loop (i.e., a loop with no edges that
contains no points.)
Returns a new loop with one vertex that creates a full loop (i.e., a loop with no edges that
contains all points).
Computes the convex hull of the input geometry provided.
Construct a loop consisting of the two vertices and their midpoint.
Constructs a 3-vertex polygon consisting of "p" and two nearby vertices.
Returns the loop at the given index.
Returns a fractal loop centered around the a-axis of the given coordinate frame, with the first
vertex in the direction of the positive x-axis, and the given nominal radius.
As above, but does not CHECK-fail on invalid input.
Given a string of latitude-longitude coordinates in degrees, returns a newly allocated loop.
Create a circle of points with a given center, radius, and number of vertices.
Fast/unsafe loop initialization.
Returns a simplified loop, which may be self-intersecting, or null if the entire loop was
within the tolerance.
Returns a new loop where the vertices of the given loop have been snapped to the centers of
cells at the specified level.
Returns a loop along the boundary of this cell, with vertices at intersections with the cell
grid at level
.
void
Adds a loop to the input geometry.
void
Adds all edges in the given loop.
private boolean
Returns true if any loop contains the given loop.
private boolean
Returns true if any loop intersects the given loop.
(package private) boolean
(package private) boolean
Returns true if two loops have the same boundary except for vertex perturbations.
(package private) boolean
Returns true if two loops have the same boundary.
(package private) boolean
(package private) boolean
Returns true if the two loop boundaries are within maxError
of each other along their
entire lengths.
int
Returns +1 if A contains the boundary of B, -1 if A excludes the boundary of B, and 0 if the
boundaries of A and B cross.
(package private) int
Returns +1 if this polygon (A) contains the boundary of B, -1 if A excludes the boundary of B,
and 0 if the boundaries of A and B cross.
int
Comparator (needed by Comparable interface)
boolean
Return true if the region contained by this loop is a superset of the region contained by the
given other loop.
boolean
Given two loops of a polygon, return true if A contains B.
private boolean
Given a polygon A and a loop B whose boundaries do not cross, returns true if A contains the
boundary of B.
private boolean
private void
(package private) static boolean
Test for crossings between all edge pairs that do not share a vertex.
(package private) static boolean
Given an S2ShapeIndex containing a single loop, return true if the loop has a self-intersection
(including duplicate vertices) and set "error" to a human-readable error message.
(package private) static boolean
Given two loop edges for which RobustCrossing returned a non-negative result "crossing",
returns true if there is a crossing and sets "error" to a human-readable error message,
otherwise returns false.
private static boolean
This method checks all edges of loop A for intersection against all edges of loop B.
private void
private static void
boolean
Return true if the region contained by this loop intersects the region contained by the given
other loop.
(package private) boolean
Helper method called by boundaryNear()
to determine if this loop and loop b
remain within maxError
of each other, starting the comparison with this loop at vertex
a_offset
and loop b
at vertex 0.
private void
Erases all edges of the given loop and marks them as unused.
Returns a new loop where the vertices of the given loop have been snapped to the centers of
cells at the specified level.
Convert an S2Loop to the S2TextFormat string representation documented above.
boolean
Assembles the given edges into as many non-crossing loops as possible.
(package private) static boolean
Given an S2ShapeIndex containing a set of loops, return true if any loop has a
self-intersection (including duplicate vertices) or crosses any other loop (including vertex
crossings and duplicate edges) and set "error" to a human-readable error message.
(package private) static boolean
Returns true if any of the given loops crosses a different loop (including vertex crossings) or
two loops share a common edge, and sets "error" to a human-readable error message.
(package private) static boolean
Returns true if any of the given loops has a self-intersection (including a duplicate vertex),
and set "error" to a human-readable error message.
(package private) static boolean
Given two loop edges for which RobustCrossing returned a non-negative result "crossing",
returns true if there is a crossing and sets "error" to a human-readable error message,
otherwise returns false.
void
private void
private void
void
Initializes this polygon from a set of hierarchically nested loops.
void
Like
S2Polygon.initNested(List)
, but expects loops to be oriented such that the polygon interior
is on the left-hand side of all loops.
void
Initializes a polygon from a set of
S2Loop
s.
void
Initializes a polygon from a set of
S2Loop
s.
private static void
private static void
static boolean
Returns true if the given loops form a valid polygon, including checking whether the loops
themselves are valid.
void
Appends the loops of this polygon to the given list and resets this polygon to be empty.
private static void
For each map entry, sorts the value list.
private static void
For each map entry, sorts the value list.