DuckDB Spatial (the official spatial extension for DuckDB, open-source under the MIT license) brings spatial data types and SQL geospatial operations to the embedded analytical (OLAP) DuckDB database engine. Designed for fast analytical queries over large tables, GeoParquet files, and multi-format vector datasets via GDAL integration, DuckDB Spatial lets data analysts, GIS developers, and researchers run spatial joins, geometry constructors, transformations, and aggregations directly inside SQL, Python, or R without standing up a heavy database server.
1. In-Depth Review: Why Data & GIS Analysts Use DuckDB Spatial
- Embedded Columnar OLAP Speed for Spatial Analytics: Runs inside DuckDB's fast in-process analytical engine, excelling at large table aggregations, filtering, and analytical spatial SQL workflows.
- Native GeoParquet & GDAL Vector Format Interoperability: Reads and writes GeoParquet and supports numerous vector formats through bundled GDAL capabilities, bridging modern columnar analytics with standard GIS files.
- One-Command Extension Install & Python/R Ecosystem Fit: Installs via `INSTALL spatial;` and loads via `LOAD spatial;` per connection, integrating smoothly with Python, R (`duckspatial` / `sf`), and modern spatial data pipelines.
2. Key Features & Capabilities
- Spatial Types & Geometry Operations: Supports `GEOMETRY` and specialized spatial types with SQL spatial functions for geometry creation, measurement, predicates, and transformations.
- GeoParquet & GDAL Vector I/O: Reads and writes GeoParquet and reads/exports spatial vector formats via GDAL.
- SQL, Python & R Client Support: Runs queries from the DuckDB CLI, Python (`duckdb`), and R packages such as `duckspatial`.
- Out-of-Core Columnar Workflows: Works effectively with larger-than-memory Parquet/GeoParquet datasets and filter-heavy analytical pipelines.
- Open-Source MIT Licensing: Free to use, embed, and distribute under the permissive MIT license.
- Extension Caching & Offline Readiness: Persists downloaded extension binaries locally per DuckDB version for repeated local connections.
- Official Links: Free Trial, Free / Education & Pricing
Always install the DuckDB spatial extension through DuckDB's official extension repository or verify documentation and source code via official DuckDB portals:
- Official DuckDB Spatial Extension Documentation: https://duckdb.org/docs/1.4/core_extensions/spatial/overview
- Official DuckDB Spatial GitHub Repository: https://github.com/duckdb/duckdb-spatial
- Official DuckDB Website: https://duckdb.org/
- Pricing & Licensing (100% Free & Open-Source under MIT License): https://github.com/duckdb/duckdb-spatial

4. Step-by-Step Installation Guide
- Verify Operating System & DuckDB Runtime: Confirm your workstation runs a supported 64-bit Windows, macOS, or Linux environment with DuckDB CLI, Python (`duckdb`), or R installed.
- Install the Spatial Extension: Open your DuckDB CLI or Python session with network access and run `INSTALL spatial;` (or `con.execute("INSTALL spatial;")` in Python) to download and cache the extension for your DuckDB version.
- Load the Spatial Extension per Connection: Run `LOAD spatial;` whenever you open a new DuckDB connection or session that needs spatial SQL functions (note that `spatial` is not autoloaded by default).
- Verify Extension Status: Query `SELECT extension_name, installed, loaded FROM duckdb_extensions() WHERE extension_name = 'spatial';` to confirm the extension is installed and loaded.
5. How to Use DuckDB Spatial: Beginner Workflow
- Start a DuckDB Session & Load `spatial`: Open DuckDB (via CLI or Python) and execute `INSTALL spatial;` (once per DuckDB version) followed by `LOAD spatial;`.
- Read Spatial Data (GeoParquet or Vector Files): Query a GeoParquet file or read spatial vector data into a DuckDB table or view using spatial SQL functions.
- Run Spatial & Analytical SQL Queries: Filter attributes, compute areas/lengths or geometry transformations, and perform spatial joins/predicates alongside standard DuckDB SQL analytics.
- Check Coordinate Reference Systems Carefully: Ensure your input layers and transformations use consistent CRS definitions and watch out for planar vs. spherical assumptions (DuckDB Spatial does not provide general spherical geometry support or spatial indexing in the same way a server GIS database does).
- Export Results to GeoParquet or GIS Formats: Save query outputs to `.parquet` / GeoParquet or export spatial tables for use in QGIS, GeoPandas, or R.
6. Frequently Asked Questions (FAQ)
- Is DuckDB Spatial free for commercial and research use?Yes. DuckDB Spatial is open-source software licensed under the MIT license with no paid license fees.
- Does `LOAD spatial;` persist automatically across new connections?No. `INSTALL spatial;` downloads and caches the extension per DuckDB version, while `LOAD spatial;` must be executed on each new connection.
- Does DuckDB Spatial support spatial indexing or spherical lat/lon geometry?No. Its documentation notes limitations including no support for spatial indexing and no support for spherical geometry (such as raw latitude/longitude coordinates).