Throwing an index at a poorly designed query fixes nothing. A spatial index is a deliberate choice between three incompatible strategies, each optimized for different workloads.
Tree-based indexes (R-Tree, Quadtree) excel in transactional systems. PostGIS uses GiST. They dynamically balance and rebalance as data changes. Fast point lookups and small-area queries. Terrible for distributed data lakes—rebalancing requires coordination, and tree traversal becomes sequential at scale.
Grid systems (H3, Geohash) convert geometry to sortable strings. “Find all features in this hexagon” becomes a prefix match on a string index. No expensive intersection math. Scales linearly. The trade-off: inflexible cell sizes and edge artifacts at grid boundaries. Better for analytics than transactions.
Space-filling curves (Z-order, Hilbert) preserve spatial locality as one-dimensional ordering. Data sorted by Z-order curve clusters nearby features naturally. Columnar storage (Parquet, Zarr) benefits immediately—a bounding box query reads contiguous blocks, not scattered chunks. This is why GeoParquet with spatial sorting crushes unsorted alternatives.
The mistake: expecting one index to solve everything. Tree indexes are write-friendly but don’t scale. Grid systems are read-optimized but require schema rigidity. Space-filling curves are storage-optimized but need deliberate clustering.
The rule: Use trees for transactions, grids for distributed analytics. Index the bounding box, compute the vertex. Space-filling curves are the bridge between cheap cloud storage and fast spatial performance.
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!


