Migrate spatial code from sp/rgeos to sf
We are migrating the spatial codebase from the legacy sp/rgeos stack to the sf package.
This is motivated by the deprecation of rgeos and the recommendation to use sf for vector data handling in R
Scope:
- Remove remaining
rgeosdependencies and replace them withsfequivalents - Gradually phase out
spusage where feasible, while keepingsptemporarily available if needed - Ensure all new spatial developments use
sfonly
Tasks:
- Replace all
rgeoscalls (e.g. distance and centroid functions) with the correspondingsffunctions - Convert
Spatial*objects loaded from files tosfobjects early in the workflow - Replace
@dataaccess patterns with sf/data.frame access ($,[[ ]]) - Run the app and scripts to confirm there are no runtime errors related to spatial operations and that behaviour remains unchanged from a user point of view