IdentitySnapFunction

A SnapFunction that snaps every vertex to itself. It should be used when vertices do not need to be snapped to a discrete set of locations (such as E7 lat/lngs), or when maximum accuracy is desired.

If the given "snap_radius" is zero, then all input vertices are preserved exactly. Otherwise, S2Builder merges nearby vertices to ensure that no vertex pair is closer than "snap_radius". Furthermore, vertices are separated from non-incident edges by at least "min_edge_vertex_separation", equal to (0.5 * snap_radius). For example, if the snap_radius is 1km, then vertices will be separated from non-incident edges by at least 500m.

Constructors

this
this()

The default constructor uses a snap_radius of zero (i.e., no snapping).

this
this(S1Angle snap_radius)

Convenience constructor that calls set_snap_radius().

this
this(IdentitySnapFunction other)
Undocumented in source.

Members

Functions

clone
S2Builder.SnapFunction clone()
Undocumented in source. Be warned that the author may not have intended to support it.
minEdgeVertexSeparation
S1Angle minEdgeVertexSeparation()
Undocumented in source. Be warned that the author may not have intended to support it.
minVertexSeparation
S1Angle minVertexSeparation()

For the identity snap function, all vertex pairs are separated by at least snap_radius().

setSnapRadius
void setSnapRadius(S1Angle snap_radius)

REQUIRES: snap_radius <= SnapFunction::kMaxSnapRadius()

snapPoint
S2Point snapPoint(S2Point point)
Undocumented in source. Be warned that the author may not have intended to support it.
snapRadius
S1Angle snapRadius()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From SnapFunction

snapRadius
S1Angle snapRadius()

The maximum distance that vertices can move when snapped.

kMaxSnapRadius
S1Angle kMaxSnapRadius()

The maximum snap radius is just large enough to support snapping to S2CellId level 0. It is equivalent to 7800km on the Earth's surface.

maxEdgeDeviation
S1Angle maxEdgeDeviation()

The maximum distance that the center of an edge can move when snapped. This is slightly larger than "snap_radius" because when a geodesic edge is snapped, the center of the edge moves further than its endpoints.

minVertexSeparation
S1Angle minVertexSeparation()

The guaranteed minimum distance between vertices in the output. This is generally some fraction of "snap_radius".

minEdgeVertexSeparation
S1Angle minEdgeVertexSeparation()

The guaranteed minimum spacing between edges and non-incident vertices in the output. This is generally some fraction of "snap_radius".

snapPoint
S2Point snapPoint(S2Point point)

Returns a candidate snap site for the given point. The final vertex locations are a subset of the snap sites returned by this function (spaced at least "min_vertex_separation" apart).

clone
SnapFunction clone()
Undocumented in source.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta