S2BooleanOperation.Precision

With Precision::EXACT, the operation is evaluated using the exact input geometry. Predicates that use this option will produce exact results; for example, they can distinguish between a polyline that barely intersects a polygon from one that barely misses it. Constructive operations (ones that yield new geometry, as opposed to predicates) are implemented by computing the exact result and then snap rounding it according to the given snap_function() (see below). This is as close as it is possible to get to the exact result while requiring that vertex coordinates have type "double".

With Precision::SNAPPED, the input regions are snapped together *before* the operation is evaluated. So for example, two polygons that overlap slightly will be treated as though they share a common boundary, and similarly two polygons that are slightly separated from each other will be treated as though they share a common boundary. Snapped results are useful for dealing with points, since in S2 the only points that lie exactly on a polyline or polygon edge are the endpoints of that edge.

Conceptually, the difference between these two options is that with Precision::SNAPPED, the inputs are snap rounded (together), whereas with Precision::EXACT only the result is snap rounded.

Values

ValueMeaning
EXACT
SNAPPED

Meta