Skip to content

Support duckspatial native GeoArrow streams - #19

Merged
tim-salabim merged 1 commit into
r-spatial:mainfrom
e-kotov:feat/duckspatial-support
Sep 14, 2026
Merged

tim-salabim merged 1 commit into
r-spatial:mainfrom
e-kotov:feat/duckspatial-support

Conversation

@e-kotov

@e-kotov e-kotov commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds direct support for duckspatial_df objects.

When addSource() receives a duckspatial_df, it requests DuckSpatial's native GeoArrow representation. This lets users pass lazy DuckDB spatial query results directly to a Deck.gl layer without first collecting an sf object or manually converting WKB geometries.

This depends on Cidree/duckspatial#150, which fixes native = TRUE to produce native GeoArrow Point, LineString, and Polygon layouts.

Example

library(duckspatial)
library(mapgl)
library(deckglgeoarrow)

countries <- ddbs_open_dataset(
  system.file(
    "spatial/countries.geojson",
    package = "duckspatial"
  )
)

maplibre(projection = "mercator") |>
  addGeoArrowPolygonLayer(
    data = countries,
    geom_column_name = attr(countries, "sf_column"),
    tooltip = "NAME_ENGL"
  )

Users do not need to set native = TRUE; deckglgeoarrow selects that conversion automatically.

The included test checks that duckspatial_df inputs use the native GeoArrow path without adding DuckSpatial as a package dependency.

@e-kotov
e-kotov marked this pull request as ready for review September 12, 2026 14:37
@tim-salabim
tim-salabim merged commit a09de2f into r-spatial:main Sep 14, 2026
0 of 6 checks passed
@e-kotov
e-kotov deleted the feat/duckspatial-support branch September 17, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants