duckspatial (development version)
MAJOR CHANGES
duckspatial_dfbecomes the main class ofduckspatial. It represents a lazy, table-like object whose data is not loaded into memory until explicitly materialized (withddbs_collect()orst_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 waysfwould do, that can be done withmode = "sf"(#55, #63).Polymorphic API: some functions such as
ddbs_area()can be used inside {dplyr} verbs, such asmutate(area = ddbs_area(geometry)(#92).ddbs_buffer(): now has four new arguments:num_triangles,cap_style,join_style, andmitre_limit(#72).ddbs_union(): is split into two new functions depending on the desired behavior:ddbs_union()andddbs_union_agg()(#77).ddbs_length(),ddbs_area()andddbs_distance(): now use by default the best DuckDB function (e.g.ST_Area()orST_Area_Spheroid()) depending on the input’s CRS. They also return aduckspatial_dfobject by default rather than a materialized vector. In the case ofddbs_distance(), it returns atbl_duckdb_connection(#80, #82, #103).ddbs_simplify(): tolerance defaults to 0; gains a new argumentpreserve_topologyspecified beforeconn(#86).ddbs_is_simple(),ddbs_is_valid(),ddbs_area(),ddbs_length(),ddbs_distance(): thenew_columnargument 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, usemode = "sf"(#83).ddbs_predicate()and colleagues: they gain new arguments: name, mode, overwrite, and quiet. Whenmode = "duckspatial", they return a lazy tbl backed by DuckDB. Whenmode = "sf", they return a list/matrix (#105).
NEW FEATURES
ddbs_as_spatial(): converts a table with coordinates into a spatial object (#75).ddbs_geometry_type(): returns the geometry type of an object (#76).ddbs_as_geojson(): converts the geometry to geojson format (#84).ddbs_perimeter(): calculates the perimeter of polygons (#89).New geometry validation/check functions:
ddbs_is_empty(),ddbs_is_ring()andddbs_is_closed()(#91).ddbs_sym_difference(): performs symmetric difference between pairs of geometries (#91).ddbs_force_2d(),ddbs_force_3d(),ddbs_force_4d(): force the geometries to have specfic dimensions (#91).ddbs_has_z()andddbs_has_m(): check if the geometry has the dimension (#91).ddbs_polygonize(),ddbs_build_area(): generates polygons from lines (#91).ddbs_voronoi(): generates Voronoi diagrams from point geometries (#91).ddbs_endpoint(): extracts the endpoint of a linestring geometry (#91).ddbs_flip_coordinates(): swaps X and Y coordinates (#91).ddbs_register_vector(),ddbs_write_vector()andddbs_read_vector()deprecated in favour ofddbs_register_table(),ddbs_write_table()andddbs_read_table()(#100).
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 byfieldwhen output ispolygonandtilexy(#78).ddbs_crs(): accepts CRS codes andcrsobjects as inputs. It returnsNULLwhen the input doesn’t have a geometry (e.g. adata.frame) (#87).
BUG FIXES
ddbs_length(),ddbs_area()andddbs_distance()were calculating the wrong measure when the CRS was geographic (#82).ddbs_filter(predicate = "dwithin")andddbs_is_within_distancewere calculating wrong distances for geographic CRS (#88).
duckspatial 0.9.0
CRAN release: 2026-01-10
Learn more about this version here.
MAJOR CHANGES
connargument defaults now toNULL. This parameter is not mandatory anymore in spatial operations, and it will be handled internally. The argument has been moved afterx,y, and function-mandatory arguments (#9).ddbs_write_vector()allows to create a temporary view with the argumenttemp = TRUE, which is much faster than creating a table (#14).ddbs_read_vector()uses internal optimizations withgeoarrowmaking it much faster (#15).The spatial functions allow now to have either an
sfor a DuckDB table as input (x) and/or output (name = NULLorname != NULL) (#19).The
crsandcrs_columnarguments are deprecated and will be removed induckspatialv1.0.0. This change aligns with planned native CRS support in DuckDB, scheduled for v1.5.0 (expected February 2025) (#7).
NEW FEATURES
Affine functions:
ddbs_rotate(),ddbs_rotate_3d(),ddbs_shift(),ddbs_flip(),ddbs_scale(), andddbs_shear()(#37).ddbs_boundary(): returns the boundary of geometries (#17).ddbs_concave_hull(): new function to create the concave hull enclosing a geometry (#23).ddbs_convex_hull(): new function to create the convex hull enclosing a geometry (#23).ddbs_create_conn(): new convenient function to create a DuckDB connection with spatial extension installed and loaded.ddbs_drivers(): get list of GDAL drivers and file formats supported by DuckDB spatial extension.ddbs_join(): new function to perform spatial join operations (#6).ddbs_length(): adds a new column with the length of the geometries (#17).ddbs_area(): adds a new column with the area of the geometries (#17).ddbs_distance(): calculates the distance between two geometries (#34).ddbs_is_valid(): adds a new logical column asserting the simplicity of the geometries (#17).ddbs_is_valid(): adds a new logical column asserting the validity of the geometries (#17).ddbs_make_valid(): makes the geometries valid (#17).ddbs_simplify(): makes the geometries simple (#17).ddbs_bbox(): calculates the bounding box (#25).ddbs_envelope(): returns the envelope of the geometries (#36).ddbs_union(): union of geometries (#36).ddbs_combine(): combines geometries into a multi-geometry (#36).ddbs_quadkey(): calculates quadkey tiles from point geometries (#52).ddbs_exterior_ring(): returns the exterior ring (shell) of a polygon geometry (#45).ddbs_make_polygon(): create a POLYGON from a LINESTRING shell (#46).ddbs_predicate(): spatial predicates between two geometries (#28).ddbs_intersects(),ddbs_crosses(),ddbs_touches(), …: shortcuts for e.g.:ddbs_predicate(predicate = "intersects")(#28).ddbs_transform(): transforms from one coordinates reference system to another (#43).ddbs_as_text(): converts geometries to well-known text (WKT) format (#47).ddbs_as_wkb(): converts geometries to well-known binary (WKB) format (#48).ddbs_generate_points(): generates random points within the bounding box ofx(#54).Spatial predicates: spatial predicates are all included in a function called
ddbs_predicate(), where the user can specify the spatial predicate. Another option, it’s to use the spatial predicate function, such asddbs_intersects(),ddbs_crosses(),ddbs_touches(), etc.
MINOR CHANGES
All functions now have a parameter
quietthat 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(): usesintersectsforST_Intersectsinstead ofintersection.ddbs_filter(): doesn’t return duplicated observations when the same geometry fulfills the spatial predicate in more than one geometries ofy(#50).
duckspatial 0.2.0
CRAN release: 2025-04-29
NEW FEATURES
-
ddbs_read_vector(): gains a new argumentclausesto modify the query from the table (e.g. “WHERE …”, “ORDER BY…”)
NEW FUNCTIONS
ddbs_list_tables(): lists table schemas and tables inside the databaseddbs_glimpse(): check first rows of a tableddbs_buffer(): calculates the buffer around the input geometryddbs_centroid(): calculates the centroid of the input geometryddbs_difference(): calculates the geometric difference between two objects
IMPROVEMENTS
ddbs_intersection(): overwrite argument defaults toFALSEinstead ofNULLBetter schemas management. Added support for all functions.
