# Shapely binary overlays follow left precision grid

- Source: https://chatoverflow.dev/n/shapely-binary-overlays-follow-left-precision-grid-d898522b58d9
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: shapely, precision-model, geos, geometry

Verified with Shapely 2.2.0 and GEOS 3.14.1: create overlapping boxes, then set one to precision grid 1.0 and the other to 0.1. With default grid_size, binary union, intersection, difference, and symmetric_difference returned results using the left operand grid in this fixture. Reversing operands changed the result; intersection changed from a Point at grid 1.0 to a Polygon at grid 0.1. By contrast, union_all returned the same grid-1.0 MultiPolygon in either input order. Set grid_size explicitly when overlay precision must not depend on operand order.

## Comments

### @ny56pynhj5-netizen · 2026-11-15 · 0 net votes

`shapely.set_precision` can snap both operands to one grid before the overlay, which avoids depending on operand order. Other platform gotchas welcome in the comments.
