Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b686657
Fix CRAN issues
Cidree Jun 24, 2026
76c1ee7
Set up Quarto in rhub
Cidree Jun 24, 2026
597ac93
Install Quarto in rhub
Cidree Jun 24, 2026
4f619e9
fix: Propagate R_LIBS in vignettes and fix checkout action version.
Cidree Jun 24, 2026
42e9c69
fix: Install sudo and jq before Quarto setup in r-hub containers.
Cidree Jun 24, 2026
489cf82
fix: Fix duplicated word and ampersand in DESCRIPTION.
Cidree Jun 24, 2026
c74c520
build: Bump version to 1.1.3 for CRAN re-submission.
Cidree Jun 24, 2026
eca9e0f
fix: Detect package manager for Quarto deps in r-hub containers.
Cidree Jun 25, 2026
d2d2c23
feat: New function: ddbs_get_ninterior_rings.
Cidree Jun 25, 2026
cc5ff06
feat: New functions: ddbs_geom_from.
Cidree Jun 25, 2026
f292e28
fix: Install wget for Quarto setup in r-hub containers.
Cidree Jun 26, 2026
bbc94cb
feat: New functions: ddbs MVT (ddbs_as_mvt_geom, ddbs_write_mbtiles).
Cidree Jun 26, 2026
b7b8619
fix: ddbs_as_geojson() converts all columns into Feature properties (…
Cidree Jun 26, 2026
ad7a112
feat: ddbs_as_geojson() returns a FeatureCollection by default (#141).
Cidree Jun 26, 2026
0a31433
perf: build ddbs_as_geojson() output via string concatenation.
Cidree Jun 26, 2026
80e8c84
docs: Sort news
Cidree Jun 26, 2026
5270e21
feat: New functions: ddbs_reverse, ddbs_normalize, ddbs_intersection_…
Cidree Jun 27, 2026
f846f24
docs: Add plan-first step to the Adding a New Function workflow in CL…
Cidree Jun 27, 2026
2915354
feat: New function: ddbs_extension_info (#143).
Cidree Jun 27, 2026
37077db
refactor: Add repos argument to ddbs_install (#144)
Cidree Jun 27, 2026
870ee74
Merge branch 'new-feats' into feature/cran-issue
Cidree Jun 27, 2026
da1d584
Merge pull request #145 from Cidree/feature/cran-issue
Cidree Jun 27, 2026
6a1c76b
build: Upgrade to checkout@v6
Cidree Jun 27, 2026
3dc42e4
refactor: Remove incorrect requires_version_upgrade column
Cidree Jun 27, 2026
93b0fff
docs: Update documentation
Cidree Jun 27, 2026
783ad3f
fix: Ensure installation of json extension
Cidree Jun 27, 2026
f8c5160
fix: Fix failing test in windows-latest
Cidree Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@ Tests use **testthat edition 3**. `tests/testthat/setup.R` loads shared spatial

## Adding a New Function

When implementing a new exported function, complete **all four steps** before considering the task done.
When implementing a new exported function, first write a plan (step 0), get it approved, then complete the remaining steps before considering the task done.

### 0. Plan first (before writing any code)

Present a short, written plan and wait for approval before implementing. The plan should cover:

- **Name**: the proposed `ddbs_*` name, and whether it should follow an existing family convention (e.g. `ddbs_line_*` for linestring ops, `ddbs_get_n*` for counts) rather than a bare mirror of the `ST_*` name.
- **R file**: which `R/` script it goes in (see Key File Map).
- **pkgdown**: which `reference:` section in `_pkgdown.yml` it belongs to.
- **Macro**: whether to also register a DuckDB macro (in `R/utils_not_exported.R`) so it works inside `dplyr::mutate()`/`summarise()`.

Before presenting the plan, verify the DuckDB function empirically (signature, return type, CRS behaviour, edge cases) with a quick query rather than assuming.

### 1. Implementation and documentation

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_as_cran.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dev_build_duckdb-r-spatial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

steps:
- name: Checkout DuckDB
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: duckdb/duckdb
ref: ${{ inputs.duckdb_ref || 'main' }}
Expand All @@ -59,7 +59,7 @@ jobs:
echo "DuckDB Version: $DUCKDB_VERSION"

- name: Checkout DuckDB R Package
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: ${{ inputs.duckdb_r_repo || 'duckdb/duckdb-r' }}
ref: ${{ inputs.duckdb_r_ref || 'main' }}
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:

# Checkout DuckDB for spatial extension build
- name: Checkout DuckDB
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: duckdb/duckdb
ref: ${{ needs.vendor.outputs.duckdb_sha }}
Expand All @@ -207,7 +207,7 @@ jobs:

# Checkout duckdb-spatial
- name: Checkout DuckDB Spatial
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: ${{ inputs.spatial_repo || 'duckdb/duckdb-spatial' }}
ref: ${{ inputs.spatial_ref || 'main' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ jobs:
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- name: Install Quarto dependencies (sudo, jq, wget)
run: |
if command -v apt-get >/dev/null; then
apt-get update -q && apt-get install -y -q sudo jq wget
elif command -v dnf >/dev/null; then
dnf install -y sudo jq wget
elif command -v yum >/dev/null; then
yum install -y sudo jq wget
else
echo "No supported package manager found (apt-get/dnf/yum)" >&2
exit 1
fi
- uses: quarto-dev/quarto-actions/setup@v2
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
Expand Down Expand Up @@ -89,6 +102,7 @@ jobs:
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: quarto-dev/quarto-actions/setup@v2
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testcov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: duckspatial
Title: R Interface to 'DuckDB' Database with Spatial Extension
Version: 1.1.2
Version: 1.1.2.9000
Authors@R: c(
person(
"Adrián", "Cidre González",
Expand All @@ -21,10 +21,11 @@ Authors@R: c(
role = "aut",
comment = c(ORCID = "0000-0003-2125-7465")
))
Description: Fast & memory-efficient functions to analyze and manipulate large
spatial data data sets. It leverages the fast analytical
capabilities of 'DuckDB' and its spatial extension (see <https://duckdb.org/docs/stable/core_extensions/spatial/overview>)
while maintaining compatibility with R’s spatial data ecosystem to
Description: Fast and memory-efficient functions to analyze and manipulate large
spatial datasets. It leverages the fast analytical
capabilities of ‘DuckDB’ and its spatial extension (see
<https://duckdb.org/docs/stable/core_extensions/spatial/overview>)
while maintaining compatibility with R’s spatial data ecosystem to
work with spatial vector data.
URL: https://cidree.github.io/duckspatial/, https://github.com/Cidree/duckspatial
BugReports: https://github.com/Cidree/duckspatial/issues
Expand Down Expand Up @@ -55,6 +56,7 @@ Suggests:
areal,
bench,
duckdbfs,
geojsonsf,
ggplot2 (>= 3.3.1),
knitr,
lwgeom,
Expand Down
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export(ddbs_affine)
export(ddbs_area)
export(ddbs_as_geojson)
export(ddbs_as_hexwkb)
export(ddbs_as_mvt_geom)
export(ddbs_as_points)
export(ddbs_as_text)
export(ddbs_as_wkb)
Expand Down Expand Up @@ -80,6 +81,7 @@ export(ddbs_dump)
export(ddbs_endpoint)
export(ddbs_envelope)
export(ddbs_equals)
export(ddbs_extension_info)
export(ddbs_exterior_ring)
export(ddbs_filter)
export(ddbs_flip)
Expand All @@ -89,8 +91,14 @@ export(ddbs_force_3d)
export(ddbs_force_4d)
export(ddbs_generate_points)
export(ddbs_geom_col)
export(ddbs_geom_from_geojson)
export(ddbs_geom_from_hexewkb)
export(ddbs_geom_from_hexwkb)
export(ddbs_geom_from_text)
export(ddbs_geom_from_wkb)
export(ddbs_geometry_type)
export(ddbs_get_ngeometries)
export(ddbs_get_ninterior_rings)
export(ddbs_get_npoints)
export(ddbs_get_resources)
export(ddbs_glimpse)
Expand All @@ -99,6 +107,7 @@ export(ddbs_has_z)
export(ddbs_install)
export(ddbs_interpolate_aw)
export(ddbs_intersection)
export(ddbs_intersection_agg)
export(ddbs_intersects)
export(ddbs_intersects_extent)
export(ddbs_is_closed)
Expand All @@ -113,6 +122,7 @@ export(ddbs_line_endpoint)
export(ddbs_line_interpolate)
export(ddbs_line_locate_point)
export(ddbs_line_merge)
export(ddbs_line_node)
export(ddbs_line_startpoint)
export(ddbs_line_substring)
export(ddbs_list_tables)
Expand All @@ -129,6 +139,7 @@ export(ddbs_minimum_rotated_rectangle)
export(ddbs_mmax)
export(ddbs_mmin)
export(ddbs_multi)
export(ddbs_normalize)
export(ddbs_open_dataset)
export(ddbs_options)
export(ddbs_overlaps)
Expand All @@ -140,9 +151,11 @@ export(ddbs_quadkey)
export(ddbs_read_meta)
export(ddbs_read_table)
export(ddbs_read_vector)
export(ddbs_reduce_precision)
export(ddbs_register_table)
export(ddbs_register_vector)
export(ddbs_remove_repeated_points)
export(ddbs_reverse)
export(ddbs_rotate)
export(ddbs_rotate_3d)
export(ddbs_scale)
Expand All @@ -165,6 +178,7 @@ export(ddbs_voronoi)
export(ddbs_within)
export(ddbs_within_properly)
export(ddbs_write_dataset)
export(ddbs_write_mbtiles)
export(ddbs_write_table)
export(ddbs_write_vector)
export(ddbs_x)
Expand Down
38 changes: 38 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@



# duckspatial (development version)

## NEW FEATURES

* `ddbs_extension_info()`: prints a `glimpse()` of a DuckDB extension's row from `duckdb_extensions()` (the spatial extension by default), showing its installed/loaded status, version, and install path.

* `ddbs_reduce_precision()`: snaps geometry coordinates to a regular grid, reducing their precision.

* `ddbs_line_node()`: nodes a set of line geometries, splitting them at every crossing and returning a fully noded `MULTILINESTRING`.

* `ddbs_intersection_agg()`: computes the geometric intersection (common area) of a set of geometries, optionally grouped by one or more columns. The intersection counterpart to `ddbs_union_agg()`.

* `ddbs_reverse()`: returns each geometry with the order of its vertices reversed.

* `ddbs_normalize()`: returns each geometry in its normalized (canonical) form.

* `ddbs_write_mbtiles()`: generates a Mapbox Vector Tile pyramid from a spatial dataset and writes it to an MBTiles file, ready to serve or convert to PMTiles.

* `ddbs_as_mvt_geom()`: transforms geometries into Mapbox Vector Tile (MVT) coordinate space, clipping them to a tile's bounding box and mapping the coordinates into the tile's integer pixel space.

* `ddbs_geom_from_text()`, `ddbs_geom_from_wkb()`, `ddbs_geom_from_hexwkb()`, `ddbs_geom_from_hexewkb()`, `ddbs_geom_from_geojson()`: parse serialized geometries (WKT, WKB, HEXWKB, HEXEWKB, GeoJSON) into a spatial object. These are the inverses of the `ddbs_as_*()` serializers.

* `ddbs_get_ninterior_rings()`: returns the number of interior rings (holes) in a POLYGON geometry.

## ENHANCEMENTS

* `ddbs_install()`: gains a `repos` argument to install an extension from a specific DuckDB repository (e.g. `"core"`, `"core_nightly"`, `"community"`). When `NULL` (default), the previous behaviour is kept (core, then community) (#144).

* `ddbs_as_geojson()`: now includes all non-geometry columns as feature `properties` instead of serializing only the geometry. By default it returns a single GeoJSON `FeatureCollection` (matching `geojsonsf::sf_geojson()`); pass `feature_collection = FALSE` for a vector with one `Feature` per row (#141).

## BUG FIXES

* `ddbs_install()`: removed a broken "already on the latest version" check that referenced a `requires_version_upgrade` column which `duckdb_extensions()` does not provide (and compared `install_mode` with the wrong case), so it never took effect (#144).


# duckspatial 1.1.2

## NEW FEATURES
Expand Down
Loading
Loading