OpenDroneMap / FIELDimageR

FIELDimageR: A R package to analyze orthomosaic images from agricultural field trials. This package is a compilation of functions to analyze pos-mosaicking images from research fields, and allows to: crop the image; remove soil effect; build vegetation indices; rotate the image; build the plot shapefile; extract information for each plot; and evaluate stand count, canopy percentage, and plant height.
GNU General Public License v2.0
230 stars 89 forks source link

Upcoming changes to R spatial packages #44

Open nfahlgren opened 1 year ago

nfahlgren commented 1 year ago

Article: https://geocompx.org/post/2023/rgdal-retirement/

The packages rgdal, rgeos, and maptools are being removed from CRAN October 2023.

FIELDimageR does not use these directly (except for maptools, which can be removed after merging #43), but it uses sp, which has all of these as dependencies.

The article discusses the need to shift from sp to modern alternatives sf or terra.

FIELDimageR imports the following from sp:

sp::Polygon --> sf::st_polygon

sp::Polygons --> sf:: st_multipolygon

sp::SpatialPointsDataFrame --> sf:: st_sf

sp::SpatialPolygons --> sf:: st_sfc

sp::SpatialPolygonsDataFrame --> sf:: st_sf

sp::bbox --> sf:: st_bbox

sp::over --> sapply(sf::st_intersects(x, y), function(z) if (length(z) == 0) NA_integer_ else z[1])

sp::proj4string --> sf::st_crs

sp::spsample --> sf:: st_sample

sp::elide --> ?

Resources: