Skip to contents

duckspatial (development version)

MAJOR CHANGES

  • duckspatial_df becomes the main class of duckspatial. It represents a lazy, table-like object whose data is not loaded into memory until explicitly materialized (with ddbs_collect() or st_as_sf()). Every function now accepts this class as input, and it’s the returned class by default. If the user wants to materialize the result in the same way sf would do, that can be done with mode = "sf" (#55, #63).

  • Polymorphic API: some functions such as ddbs_area() can be used inside {dplyr} verbs, such as mutate(area = ddbs_area(geometry) (#92).

  • ddbs_buffer(): now has four new arguments: num_triangles, cap_style, join_style, and mitre_limit (#72).

  • ddbs_union(): is split into two new functions depending on the desired behavior: ddbs_union() and ddbs_union_agg() (#77).

  • ddbs_length(), ddbs_area() and ddbs_distance(): now use by default the best DuckDB function (e.g. ST_Area() or ST_Area_Spheroid()) depending on the input’s CRS. They also return a duckspatial_df object by default rather than a materialized vector. In the case of ddbs_distance(), it returns a tbl_duckdb_connection (#80, #82, #103).

  • ddbs_simplify(): tolerance defaults to 0; gains a new argument preserve_topology specified before conn (#86).

  • ddbs_is_simple(), ddbs_is_valid(), ddbs_area(), ddbs_length(), ddbs_distance(): the new_column argument now defaults to a column name, as we now encourage the users to keep most of the work within DuckDB, rather than materialize a vector. For materializing a vector in R, use mode = "sf" (#83).

  • ddbs_predicate() and colleagues: they gain new arguments: name, mode, overwrite, and quiet. When mode = "duckspatial", they return a lazy tbl backed by DuckDB. When mode = "sf", they return a list/matrix (#105).

NEW FEATURES

MINOR CHANGES

  • Improve the documentation of the functions (#85).

  • ddbs_buffer(): warns if the input CRS is not a projected CRS, as the distance uses its units.

  • ddbs_quadkey(): can aggregate by field when output is polygon and tilexy (#78).

  • ddbs_crs(): accepts CRS codes and crs objects as inputs. It returns NULL when the input doesn’t have a geometry (e.g. a data.frame) (#87).

BUG FIXES

  • ddbs_length(), ddbs_area() and ddbs_distance() were calculating the wrong measure when the CRS was geographic (#82).

  • ddbs_filter(predicate = "dwithin") and ddbs_is_within_distance were calculating wrong distances for geographic CRS (#88).

duckspatial 0.9.0

CRAN release: 2026-01-10

Learn more about this version here.

MAJOR CHANGES

  • conn argument defaults now to NULL. This parameter is not mandatory anymore in spatial operations, and it will be handled internally. The argument has been moved after x, y, and function-mandatory arguments (#9).

  • ddbs_write_vector() allows to create a temporary view with the argument temp = TRUE, which is much faster than creating a table (#14).

  • ddbs_read_vector() uses internal optimizations with geoarrow making it much faster (#15).

  • The spatial functions allow now to have either an sf or a DuckDB table as input (x) and/or output (name = NULL or name != NULL) (#19).

  • The crs and crs_column arguments are deprecated and will be removed in duckspatial v1.0.0. This change aligns with planned native CRS support in DuckDB, scheduled for v1.5.0 (expected February 2025) (#7).

NEW FEATURES

MINOR CHANGES

  • All functions now have a parameter quiet that allows users to suppress messages (#3).

  • Spatial operations now don’t fail when a column has a dot (#33).

  • Added some vignettes (#42).

  • ddbs_filter(): uses intersects for ST_Intersects instead of intersection.

  • ddbs_filter(): doesn’t return duplicated observations when the same geometry fulfills the spatial predicate in more than one geometries of y (#50).

duckspatial 0.2.0

CRAN release: 2025-04-29

NEW FEATURES

  • ddbs_read_vector(): gains a new argument clauses to modify the query from the table (e.g. “WHERE …”, “ORDER BY…”)

NEW FUNCTIONS

IMPROVEMENTS

  • ddbs_intersection(): overwrite argument defaults to FALSE instead of NULL

  • Better schemas management. Added support for all functions.

duckspatial 0.1.0

CRAN release: 2025-04-19

  • Initial CRAN submission.