Most spatial queries are actually two queries running invisibly. Ignore this, and you’ll wonder why your queries are slow or why “close enough” isn’t good enough.
A bounding box is the smallest axis-aligned rectangle that contains a geometry. It’s defined by minimum and maximum X and Y coordinates. That’s it. Simple. Fast to compute. Instantly tells you if two geometries might be related.
Bounding boxes solve a performance problem. A true spatial join checking exact geometry intersection for every feature pair would be prohibitively slow. Instead, databases use bounding boxes for pre-filtering. First, find all features whose bounding boxes overlap. That’s fast because bounding boxes are simple rectangles. Second, check exact geometry only on those candidates. That’s slow but only runs on a tiny subset.
This two-stage approach powers spatial indexes (the reason PostGIS queries with indexed geometries are fast). It powers tile-based rendering (only load tiles whose bounding boxes intersect the viewport). It’s everywhere.
The catch: bounding box overlap does not guarantee true intersection. Two polygons can have overlapping bounding boxes but not actually touch. If you rely only on bounding box tests, you get false positives.
Most GIS systems handle this transparently. ST_Intersects automatically runs both stages. But if you’re building custom spatial logic, understand this. A bounding box is a performance optimization, not a precision tool.
The rule: Bounding boxes filter fast, geometry checks are precise. Spatial queries do both automatically. If a spatial query is slow, the bounding box index might be missing or poorly configured. Check indexing before optimizing logic. Bounding boxes are invisible only until they’re not.
Whenever you’re ready, here are 4 ways I can help you grow in GIS & spatial data:
Spatial Lab – My private community where GIS professionals, data engineers, and analysts connect, swap workflows, and build repeatable systems together.
Modern GIS Accelerator – A guided program to help you break out of legacy GIS habits and learn modern, scalable workflows.
Career Compass – A career-focused program designed to help GIS pros navigate the job market, sharpen their pitch, and find roles beyond traditional GIS paths.
Sponsorship: Interested in sponsoring this newsletter (or other content)? Learn more here and fill out the form to get in touch!


