← Back to all sparks
D

duckspatial

ANALYTICS
Velocity0.0

R Interface to 'DuckDB' Database with Spatial Extension

duckspatial rebuilt itself around a lazy DuckDB class, then spent four releases filling in the geometry surface

rduckdbgeospatiallazy evaluationsfvector tiles
Current state
duckspatial exposes DuckDB's spatial extension to R. In March 2026 it stopped being an sf convenience wrapper: 1.0.0 made duckspatial_df the primary class, a lazy table-like object that stays in DuckDB until explicitly materialized. Every function accepts and returns it by default, with mode = 'sf' as the opt-out. The four releases since have added roughly forty geometry functions on top of that foundation.
Where it's heading
The direction is to keep work inside DuckDB and make R the orchestration layer rather than the compute layer. 1.1.0 added macros so duckspatial functions work inside dplyr verbs; 1.1.1 moved the default to DuckDB v1.5.0 native spatial storage so CRS metadata persists in GEOMETRY columns; 1.2.0 added vector-tile output via ddbs_write_mbtiles() and the full family of geometry deserializers. Feature velocity has been high and consistent since the rewrite.
Prediction
The remaining gaps are in PostGIS parity — the deserializers and tile writers landed in 1.2.0, so raster support or spatial indexing are the plausible next targets. 1.2.1 being a single message-capture fix suggests the 1.2.x line is now stabilizing.

Recent moves

  1. 1mo ago

    Capture install and load output messages

    A single-item patch capturing output messages from ddbs_install() and ddbs_load(). Housekeeping on the 1.2.0 feature wave.

    View source ↗
  2. 1mo ago

    Vector-tile output, geometry parsers and precision control

    The largest feature release since the rewrite: ddbs_write_mbtiles() and ddbs_as_mvt_geom() give the package a tile-pyramid output path, and a full set of ddbs_geom_from_*() parsers close the round trip against the existing serializers. Extends the 1.0.0 direction of keeping geometry work in DuckDB rather than pulling it into R.

    View source ↗
  3. 1mo ago

    Shortest-line, azimuth, vertex and coordinate-extreme functions

    Adds ddbs_shortest_line(), ddbs_azimuth(), ddbs_vertices(), ddbs_point() and the coordinate min/max family, plus a memory-efficient union option. Steady expansion of the geometry surface established by 1.0.0.

    View source ↗
  4. 2mo ago

    Native spatial storage becomes the default connection format

    Defaults new connections to DuckDB v1.5.0 storage so CRS metadata survives in native GEOMETRY columns, with an escape hatch for older clients. dplyr methods now return lazy views instead of materializing temp tables, tightening the lazy contract 1.0.0 set.

    View source ↗
  5. 2mo ago

    duckspatial macros usable inside dplyr verbs

    Macros let duckspatial functions be called inside mutate() and friends, so a geometry computation reads like ordinary dplyr while executing in DuckDB. Adds around fifteen geometry functions alongside it. This is the ergonomic payoff of the 1.0.0 class rewrite.

    View source ↗
  6. 4mo ago

    duckspatial_df replaces sf as the default class

    ⚡ SPARK

    The release that set the package's current direction: duckspatial_df becomes the main class, data stays lazy in DuckDB until ddbs_collect() or st_as_sf() is called, and every function accepts and returns it by default. Function defaults change to pick the appropriate DuckDB implementation by CRS, and ddbs_union() splits into row-wise and aggregate forms.

    View source ↗