Production-grade reference documentation for in-process spatial SQL. Run geospatial analytics directly inside DuckDB with vectorized, columnar execution β no GIS server, no row-by-row round trips.
π Read it live β www.analytical-sql-gis.org
A deep, engineering-grade reference for teams doing serious geospatial work with DuckDB's spatial extension. Every page is written for data engineers, GIS analysts, and Python developers who need deterministic performance at scale β the execution model behind the engine, the query patterns that keep spatial joins and aggregations vectorized, and the integration paths that move geometries between SQL and Python without serialization overhead.
Fifty in-depth guides (130k+ words), each grounded in real configuration: memory limits and spill thresholds, coordinate-system handling, GeoParquet and GeoJSON ingestion, execution-plan validation, and a full migration track for teams coming from PostGIS or GeoPandas.
| Track | What it covers |
|---|---|
| Architecture & Fundamentals | The execution model: vectorized columnar processing, GeoParquet/GeoJSON/FlatGeobuf/GeoPackage ingestion, CRS handling, R-tree indexing internals, and in-memory vs disk trade-offs. |
| Query Patterns | Engineering-grade query patterns: spatial joins and proximity filters, vectorized aggregations, window functions, clustering and grid binning, range and nearest-neighbor search, and regression-safe diagnostics. |
| Python Workflows | Zero-copy Python integration: async execution, batch pipelines, Arrow interop, connection and concurrency management, Shapely interop, and efficient DuckDB β GeoPandas synchronization. |
| Migration | Moving off PostGIS and GeoPandas: function and index translation, replacing spatial joins, CRS workflow porting, and the performance crossover points that justify the switch. |
- Vectorized, columnar execution β spatial predicates run across whole vectors of geometries through SIMD-friendly kernels instead of one row at a time.
- Zero-copy ingestion β read GeoParquet, GeoJSON, FlatGeobuf, and GeoPackage straight into Arrow buffers with schema projection and predicate pushdown.
- Embedded, no server β runs inside your Python interpreter, data pipeline, or serverless function; scale by running more bounded instances, not by operating a daemon.
- A clean migration path β function-by-function translation, GiST β R-tree index porting, and honest benchmarks that mark where DuckDB overtakes PostGIS and GeoPandas.
A static site generated with Eleventy, with hand-authored inline SVG diagrams, KaTeX for complexity notation, and build-time syntax highlighting. Everything is self-hosted β no third-party CDN β and deployed on Cloudflare.
npm install # install dependencies
npm run build # generate the static site into _site/
npm run serve # local dev server with live reloadReleased under the MIT License.
