Plan for retirement of rgdal, rgeos #471
Replies: 2 comments
-
Dear Jean, thanks a lot for your email.
Cheers,
|
Beta Was this translation helpful? Give feedback.
-
Update. I created a version of I will now try to remove Backward compatibility using: library(lidR) Note: some calls that do not work are likely to work loading e.g.
CRS
Area
Accessor
R base
Others
|
Beta Was this translation helpful? Give feedback.
-
Tagging interested persons
i.e. developers of packages that depend on lidR
@ptompalski @bi0m3trics @tgoodbody @carlos-alberto-silva @Blecigne @oliviermartin7 @DRAAlmeida @Molina-Valero @jmmonnet
aRchi FORTLS leafR lidaRtRee weblidar-treetop viewshed3d rGEDI spanner lidRmetrics
Context
rgdal
andrgeos
will be retired on Jan 1st 2024.raster
andsp
are based onrgdal
/rgeos
.lidR
is based onraster
andsp
because it was created beforesf
,terra
andstars
. This means that sooner or laterlidR
will run into trouble (actually it is more or less already the case). So we must fully move tosf
,terra
/stars
without depending onsp
andraster
. Do do so we need to:sf
/terra
object in replacement of function that returnsp
/raster
objects.LAS*
classes such as they no longer inheritsp::Spatial
. This point being by far the most complex task and it will necessarily break backward compatibilityIn this thread, I'm putting down my plan to fully remove dependency to
sp
/raster
in 2024. The plan is to do it with minimum backward incompatibilities and a lot of time to update the workflow.Warning: I'm putting here draft of ideas because it helps me to make a plan. It is in no way a definitive plan and anybody reading this is welcome to contribute to this thread.
Replacement functions
Former functions that return
sp
/raster
will be supported until it causes issues on CRAN i.e. maybe Jan 1st 2024 maybe latergrid_metrics
pixel_metrics
grid_terrain
rasterize_terrain
grid_canopy
rasterize_canopy
grid_density
rasterize_density
tree_metrics
crown_metrics
delineate_tree
crown_metrics
find_trees
locate_trees
track_sensor
track_sensor
LAS class
The current
LAS
definition is:Which implies it has
@proj4string
and@bbox
slots. To minimize backward incompatibilities we need something like:This way all user code that uses
las@data$Z
instead oflas$Z
will still work. What will fail however islas@proj4string
orlas@bbox
which is unlikely to be used. Notice thatbbox
is not useful because it is redundant with the header, it was there only by inheritance. Also functionprojection
andcrs
will still returnsp::CRS
object even if they are outdated in the R spatial ecosystem for backward compatibility.LAScatalog class
The
LAScatalog
definition isThe best option would be to become an
sf
object instead of anS4
classes but this is inconsistent with theLAS
class. One well backward compatible option isThis will still provide access to e.g.
ctg@data[["Min.Z"]]
orctg$GUID
without modifying the code. Other operation being unlikely to be performed by user. Only by internal codeLAScluster class
The
LAScluster
class definition isBut being an internal class it is easier to deal with it
New functions and functions that need an update
st_crs
;st_crs<-
forLAS
andLAScatalog
projection
;crs
;projection<-
;crs<-
spTransform
Beta Was this translation helpful? Give feedback.
All reactions