duckspatial 1.0.0
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). -
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 inside DuckDB, rather than materialize the result. For materializing a vector in R, usemode = "sf". This argument is also moved beforeconnargument (#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_points(): 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()andddbs_start_point(): extracts the start/end point 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). -
ddbs_x()andddbs_y(): extract thexandycoordinates of points (#108). -
ddbs_drop_geometry(): drops the geometry column of aduckspatial_dfobject. -
ddbs_options(): to set someduckspatialdefault options. -
ddbs_join(): dwithin is now implemented for spatial join.
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). -
ddbs_create_conn(): now has ... that are paseed todbConnect()for extra configuration.