cnefe_counts(), compute_lumi(), and tracts_to_polygon() no longer fail
in the DuckDB backend when the user-supplied sf polygon has a geometry
column not named "geom" (e.g. the sf default "geometry"). The geometry
column is now normalized before writing to DuckDB, restoring compatibility
with duckspatial (>= 1.1.0) (#70).
cnefetools now works with geobr 2.0.0. geobr 2.0.0 reads boundaries lazily
through duckspatial, which under a fixed RNG seed (e.g. R CMD check examples)
could trigger a DuckDB temporary-table name collision
(Table dbplyr_<...> already exists). The RNG state is now isolated around
the geobr call in the H3-grid path, so the dependency is no longer pinned and
any geobr version works (#74).
Fixed an RTREE spatial-index failure introduced by DuckDB 1.5 (which moved
the GEOMETRY type into core, with optional CRS parameters) combined with
duckspatial 1.0.0 (which writes CRS-parameterised geometry columns). A WKB
round-trip now strips the CRS parameter to plain GEOMETRY before the RTREE
index is created, in cnefe_counts(), compute_lumi(), and
tracts_to_polygon() (#68).
Fixed a temporary ZIP file being deleted before its DuckDB view was
materialised when cache = FALSE, which caused tracts_to_h3() and
tracts_to_polygon() to error at the CNEFE point preparation step (#68).
cache = FALSE to \donttest examples so they no longer write to the
user cache directory, resolving a CRAN check NOTE (#66).Fixed missing hexagons at the edges of the H3 grid. h3jsr::polygon_to_cells()
only returns hexagons whose centroid falls inside the municipality boundary, so
border hexagons that overlap the boundary without their center being inside
were silently excluded. build_h3_grid() now adds those hexagons by checking
the immediate neighbors of the grid against the municipality boundary (#62).
cnefe_counts() and compute_lumi() now expose a cache parameter
(default TRUE), consistent with tracts_to_h3() and tracts_to_polygon()
(#58).
New clear_cache_muni() function to delete cached CNEFE ZIP files from
the user cache directory, with optional filtering by municipality code (#59).
New clear_cache_tracts() function to delete cached census tract Parquet
files, with optional filtering by state (UF) code (#59).
skip_on_cran() fix from v0.2.1 for the
DuckDB spatial extension segfault on r-devel-linux-x86_64-fedora-clang.skip_on_cran() to test-tracts_to_h3.R to prevent a segfault on
r-devel-linux-x86_64-fedora-clang caused by an ABI mismatch between the
clang-compiled DuckDB binary and GCC-built spatial extension (duckdb/duckdb-r#1107).tracts_to_polygon() for dasymetric interpolation from census
tracts to user-supplied polygons, using CNEFE dwelling points as
ancillary data.tracts_variables_ref reference table mapping cnefetools variable
names to official IBGE census tract codes.hex_cnefe_counts() has been renamed to cnefe_counts(). The
function now accepts user-supplied polygons via polygon_type = "user"
in addition to H3 hexagons (polygon_type = "hex", default).compute_lumi() gains support for user-supplied polygons via the same
polygon_type parameter, and a new land-use mix indicator: ICE (Index
of Concentration at Extremes).tracts_to_h3() and tracts_to_polygon() gain five new interpolation
variables related to race: race_branca, race_preta, race_parda,
race_amarela and race_indigena.read_cnefe(), cnefe_counts(), compute_lumi(), and
tracts_to_h3() gain a year argument (default 2022) to prepare
for future CNEFE editions.message() calls.tracts_to_h3() and
tracts_to_polygon() with two-stage reporting structure.cnefe_counts(),
compute_lumi(), and tracts_to_polygon() with DuckDB.tracts_to_h3() and
tracts_to_polygon().bal to the compute_lumi() function.tracts_to_h3() for dasymetric interpolation from tract aggregates to CNEFE dwelling points and H3 hexagons using DuckDB (spatial + h3).backend = "r" when backend = "duckdb" is requestedread_cnefe(output = "sf") by handling missing coordinates before converting to sfCOD_ESPECIE documentation and removes tidyselect deprecation warnings in tests and internalsbackend = "duckdb" (default) or backend = "r" for hex_cnefe_counts() and compute_lumi()compute_lumi() to compute land-use mix indicators (EI, HHI, adapted HHI, BGBI) on H3 grids.