Skip to content
View analytical-sql-gis's full-sized avatar

Block or report analytical-sql-gis

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
analytical-sql-gis/README.md

DuckDB Spatial & Modern Analytical SQL for GIS

DuckDB Spatial & Modern Analytical SQL for GIS

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


What this is

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.

Explore the reference

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.

Why DuckDB for spatial analytics

  • 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.

How it's built

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 reload

License

Released under the MIT License.

Popular repositories Loading

  1. analytical-sql-gis analytical-sql-gis Public

    Production-grade reference for in-process spatial SQL with DuckDB: vectorized geospatial analytics, GeoParquet/GeoJSON ingestion, query patterns, Python integration, and PostGIS/GeoPandas migration.

    JavaScript