All Classes and Interfaces
Class
Description
A point consisting of BigDecimal coordinates.
Utilities for encoding and decoding integers.
Utilities for handling
InputStream
s.Simple utility for reading little endian primitives from a stream.
Simple utility for writing little endian primitives to a stream.
A simple 3x3 matrix.
An S2Point that also has a parameter associated with it, which corresponds to a time-like order
on the points.
Contains utility methods which require different GWT client and server implementations.
A set of interfaces for describing primitive arrays.
An array of
byte
s.A cursor storing a position and a limit.
An array of
long
s.An R1Interval represents a closed, bounded interval on the real line.
Designates which end of the interval to work with.
An R2Rect represents a closed axis-aligned rectangle in the (x,y) plane.
Valid axes.
R2Vector represents a vector in the two-dimensional space.
This class provides portable support for several exact arithmetic operations on double values,
without loss of precision.
A builder of
S1Angle
instances.S1ChordAngle represents the angle subtended by a chord (i.e., the straight 3D Cartesian line
segment connecting two points on the unit sphere).
An S1Interval represents a closed interval on a unit circle (also known as a 1-dimensional
sphere).
Defines an area or a length cell metric.
The area of an interior, i.e.
S2Cap represents a disc-shaped region defined by a center and radius.
An S2Cell is an S2Region object that represents a cell.
An S2CellId is a 64-bit unsigned integer that uniquely identifies a cell in the S2 cell
decomposition.
A list of
S2CellId
s, and specialized methods for directly operating on the encoded form.A collection of (cellId, label) pairs.
Represents a node in the (cellId, label) tree.
A function that is called with each (cellId, label) pair to be visited.
To build the cell tree and leaf cell ranges, we maintain a stack of (cellId, label) pairs that
contain the current leaf cell.
A set of labels that can be grown by
S2CellIndex.getIntersectingLabels(S2CellUnion, Labels)
and
shrunk via S2CellIndex.Labels.clear()
or S2CellIndex.Labels.normalize()
.A range of leaf S2CellIds, from the level 30 leaf cell of this range to the next range.
An S2CellUnion is a region consisting of cells of various sizes.
Given a set of points stored in an S2PointIndex, S2ClosestPointQuery provides methods that find
the closest point(s) to a given query point.
A type that is comparable on distance only.
An edge query, used to find the closest points to a query edge.
A point query, used to find the closest points to a query point.
A queued cell waiting to be processed by the current query, ordered by distance to any point in
the cell in ascending order.
A query result paired with the distance to the query target.
A kind of query target.
An interface for encoding and decoding values.
A query for whether one or more shapes in an
S2ShapeIndex
contain a given S2Point.A visitor that receives each edge that has some query point p as an endpoint.
The options for building an S2ContainsPointQuery.
A rule for whether shapes are considered to contain their vertices.
A visitor that receives each shape that contains a query point, returning true to continue
receiving shapes or false to terminate early.
This class determines whether a polygon contains one of its vertices given the edges incident to
that vertex.
S2ConvexHullQuery builds the convex hull of any collection of points, polylines, loops, and
polygons.
A comparator for sorting points in CCW around a central point "center".
An abstract directed edge from one S2Point to another S2Point.
An iterator on data edges that may cross a query edge (a,b).
S2EdgeQuery is used to find edges or shapes that are crossed by an edge.
An Edges implementation that filters edges of a shape to those that intersect the edge AB or
have an endpoint on either A or B.
An iterator over the sorted unique edge IDs of a shape that may intersect some query edge.
An
Edges
implementation optimized for merging edges from multiple S2ClippedShapes
already in sorted order.An
Edges
that contains all the edges of a shape with the given number of edges.An
Edges
implementation that includes all the edges of a clipped shape.Tracks the current edge index within a clipped shape.
This class contains various utility functions related to edges.
Used to denote which point should be used when finding distances/points.
Used to efficiently test a fixed edge AB against an edge chain.
FaceSegment represents an edge AB clipped to an S2 cube face.
The purpose of this class is to find edges that intersect a given longitude interval.
This class computes a bounding rectangle that contains all edges defined by a vertex chain v0,
v1, v2, ...
Encapsulation of a mutable error value.
Returns true if wedge A contains wedge B.
Returns true if wedge A intersects wedge B.
Wedge processors are used to determine the local relationship between two polygons that share a
common vertex.
Spatial containment relationships between a wedge A to another wedge B.
The purpose of this class is to find edges that intersect a given XYZ bounding box.
An error code and text string describing the first error encountered during a validation process.
A simple class that generates "Koch snowflake" fractals (see Wikipedia for an introduction).
A random access iterator that provides low-level access to entries sorted by cell ID.
An interface to provide the cell ID for an element in a sorted list.
This class represents a point on the unit sphere as a pair of latitude-longitude coordinates.
S2LatLngRect represents a latitude-longitude rectangle.
This class is a builder for S2LatLngRect instances.
Base class for methods shared between the immutable
S2LatLngRect
and the mutable S2LatLngRect.Builder
.A region defined by a collection of zero or more closed loops.
An encoder/decoder of
S2LaxPolygonShape
s.A multi polygon with points referenced from an array.
A multi polygon with vertices referenced from a
List<S2Point>
, and cumulative edges
referenced from an PrimitiveArrays.Longs
.A multi polygon with vertex coordinates stored in a double[].
A multi polygon with vertices at cell ID centers stored in a long[].
A simple polygon with points referenced from an array.
A simple polygon with vertex coordinates stored in a double[].
A simple polygon with vertices at cell ID centers stored in a long[].
S2LaxPolylineShape represents a polyline.
An encoder/decoder of
S2LaxPolylineShape
s.A multi polyline storing references to previously allocated S2Point instances.
A multi polyline storing xyz coordinates in a single packed 'double' array.
A multi polyline storing cell IDs in a single 'long' array.
A polyline storing references to previously allocated S2Point instances.
A polyline storing xyz coordinates in a single packed 'double' array.
A polyline storing cell IDs in a single 'long' array.
An S2Loop represents a simple spherical polygon.
Loop relation for compareBoundary().
Loop relation for contains().
Loop relation for intersects().
LoopCrosser is a helper class for determining whether two loops cross.
Offsets into two loops at which a boundary distance comparison will start.
A relation between two loops (e.g.
S2PaddedCell represents an S2Cell whose (u,v)-range has been expanded on all sides by a given
amount of "padding".
An S2Point represents a point on the unit sphere as a 3D vector.
A builder of
S2Point
instances.An S2Shape representing a list of S2Points.
An encoder/decoder of
S2Point.Shape
s.S2PointIndex maintains an index of points sorted by leaf S2CellId.
An S2Iterator-compatible pair of S2Point with associated client data of a given type.
An S2PointRegion is a region that contains a single point.
A thin wrapper over
ByteArrayOutputStream
which allows the last written byte to be
removed.Represents a point that can be encoded as an
S2CellId
center.Controls whether to optimize for speed or size when encoding points.
Represents the encoding parameters to be used for a given block (consisting of
S2PointVectorCoder.BLOCK_SIZE
encodable 64-bit values).An S2Polygon is an S2Region object that represents a polygon.
EdgeClipper finds all the intersections of a given edge with the edges contained in an
S2ShapeIndex.
Indexing structure to efficiently
S2EdgeIndex.clipEdge(com.google.common.geometry.S2Point, com.google.common.geometry.S2Point, boolean, java.util.Collection<com.google.common.geometry.ParametrizedS2Point>)
of a polygon.Indexing structure for an
S2Polygon
.This is a simple class for assembling polygons out of edges.
Options for initializing a
S2PolygonBuilder
.Builder class for
S2PolygonBuilder.Options
.An S2Polyline represents a sequence of zero or more vertices connected by straight edges
(geodesics).
A collection of geometric predicates core to the robustness of the S2 library.
A set of tests to compare the distance XY and a previously computed distance.
A set of tests to determine which of two points is closer to a reference point.
A test to compare whether two edges are closer to proceeding in the same direction or in
opposite directions around the sphere, essentially signum((AxB)x(CxD)).
A test to compare the distance from point X to edge A with a previously computed distance.
A predicate for whether an edge PQ passes to the left, to the right, or through the center of
the circumcircle of triangle ABC.
Given two sites A and B that form the center of caps of radius 'r', this indicates which sites
are irrelevant to the Voronoi diagram relative to an edge PQ.
Tests of whether three points represent a left turn (+1), right turn (-1), or neither (0).
A test for which (if any) of two Voronoi sites within R of an edge PQ are covered by the other.
This class specifies the coordinate systems and transforms used to project points from the sphere
to the unit cube to an
S2CellId
.A [face, si, ti] position.
A transform from 3D cartesian coordinates to the 2D coordinates of a face.
A transform from 2D cartesian coordinates of a face to 3D directional vectors.
An S2Region represents a two-dimensional region over the unit sphere.
An S2RegionCoverer is a class that allows arbitrary regions to be approximated as unions of cells
(S2CellUnion).
A Build to construct a
S2RegionCoverer
with options.We define our own comparison function on QueueEntries in order to make the results
deterministic.
An S2RegionIntersection represents an intersection of overlapping regions.
An S2RegionUnion represents a union of possibly overlapping regions.
S2Shape is an abstract base class that defines a shape.
A simple receiver for the endpoints of an edge.
A point with a known containment relationship.
A set of partial
shape
implementations, effectively breaking down the S2Shape API
into several aspects, each focused on a subset of the overall API:
S2ShapeAspect.VertexAspect
provides a logical list of vertices, where the 'vertexId' is
at least 0 and less than S2ShapeAspect.VertexAspect.numVertices()
.A provider of the 'edgeId' ranges for each chain, allowing alternate chain representations.
A sequence of chains, represented as an array of the first 'edgeId' for each chain.
An array of S2Point references for multiple chains.
Packed coordinates for multiple chains.
Snapped cell centers for multiple chains.
A single non-empty chain.
A simple chain of S2Point references.
A simple chain of packed coordinates.
A simple chain of packed cell centers.
A provider of the 'vertexId' for the start and end of each 'edgeId' or 'chainId'/'edgeOffset',
allowing alternate edge/vertex mappings.
Chains are closed, that is, there is an implicit edge between the ends of each chain.
Chains are open, that is, there is no implicit edge between the ends of each chain.
A full S2Shape that mixes together each aspect.
How world positions are classified as exterior, interior, or on the boundary of the object.
A provider of S2Point given a 'vertexId', allowing alternate storage options.
This class contains the set of clipped shapes within a particular index cell, sorted in
increasing order of shape id.
A specialization of Cell for the case of two clipped shapes.
A specialization of Cell for multiple shapes per cell.
The possible relationships between a "target" cell and the cells of the S2ShapeIndex.
ClippedEdge represents the portion of a FaceEdge that has been clipped to an S2Cell.
This class provides temporary storage for new ClippedEdges that are created during indexing.
FaceEdge stores temporary edge data while the index is being updated.
Options that affect construction of the S2ShapeIndex.
RangeIterator is a wrapper over CellIterator that is specialized for merging shape indices.
S2ClippedShape represents the part of a shape that intersects an S2Cell.
An S2ClippedShape for a shape that completely contains the cell (no edge intersections and
containsCenter is true.)
An S2ClippedShape containing a single range of contiguous edge IDs.
An S2ClippedShape that contains the non-contiguous edges from
start
to end
in
edges
.An S2ClippedShape that contains a single edge from a given shape.
A more complex append-only RandomAccess List that allocates space in shards of 256 elements
each, avoiding reallocation as the list grows, and avoiding single allocations larger than 2KB.
A simple append-only RandomAccess List similar to (but about 10% faster than) ArrayList.
An encoder/decoder of
S2ShapeIndex
s.Represents an encoded
S2ShapeIndex
.Defines various angle and area measures for
S2ShapeIndex
objects.This class wraps an S2ShapeIndex object with the additional methods needed to implement the
S2Region API, in order to allow S2RegionCoverer to compute S2CellId coverings of arbitrary
collections of geometry.
Defines various angle and area measures for
S2Shape
objects.A consumer which accepts two arguments.
A function which accepts an int.
Represents a cyclic ordering of the loop vertices, starting at the index "first" and proceeding
in direction "dir" (either +1 or -1).
Wraps a mutable primitive double.
Utilities for working with S2Shape.
A collector of both combined area and centroid values.
A collector of the steradian area.
A collector of the center of mass.
A filter of indexes.
S2EdgeVectorShape is an S2Shape representing a set of unrelated edges.
A consumer of triangles.
An encoder/decoder of tagged
S2Shape
s.A builder for creating
S2TaggedShapeCoder
instances.S2TextFormat contains a collection of functions for converting geometry to and from a human-
readable format.
An encoder/decoder of
PrimitiveArrays.Longs
s.