Skip to content

SnapStrategy

Strategy for robust snap noding and output coordinates.

Grid uses the precision grid for both topology and output coordinates. GeosCompat uses the grid for topology, then restores one deterministic nearest source XY coordinate per snapped node. This targets Shapely-style snap followed by full-precision noding and polygonization; it does not emulate set_precision output.

Scale Guidance: Use Grid when an explicit precision model is the desired output contract. Use GeosCompat when the grid is a robustness aid but source-coordinate fidelity matters. Both strategies are deterministic; exact GEOS/Shapely parity is not guaranteed for degenerate or many-to-one snaps.

Variants

Grid

GeosCompat