Closed Kodiologist closed 3 months ago
The problem is that both lidR
and terra
define crs
methods, and rgrass::initGRASS
needs to discover that from terra
not lidR
. If terra
is attached, the method is found, but if only loaded, it is hidden by the lidR
method. I'll try to demonstrate this with just lidR
and terra
.
Well, originally lidR inherited crs()
from raster
. Then moving to sf/terra
I created crs()
for backward compatibility. At this time I'm pretty sure terra
did not have crs()
and was using another function. Or it was not inheritable. Or I don't know, I don't remember but I was not able to inherit from terra
. The switch from sp/raster
to sf/terra
has not been easy.
I could inherit crs()
from terra
. But is is not the same signature than raster::crs()
which is the one I'm using for backward compatibility.
Last solution I can remove crs()
. Is is deprecated anyway and I'm now using st_crs()
in lidR
.
Last solution I can remove
crs()
. Is is deprecated anyway and I'm now usingst_crs()
inlidR
.
That seems like a reasonable choice to me.
I'm now inheriting terra::crs()
, terra::is.empty()
and terra::area()
which were not clashing initially because they did not exist. There is no longer any name clash with terra
. Please let me know it is ok for you.
I think that's fine, yeah. Thanks. Are you planning a new CRAN release sometime this year?
Not really. Considering you have a workaround anyway I guess it is not urgent. If somebody needs a CRAN update I'll update.
If this https://github.com/r-lidar/lidR/commit/6af88b315c30d30820dc49aa152984f3640b88c6 is the relevant commit, I can try it tomorrow morning.
@rsbivand yes this is the relevant commit.
@Jean-Romain With your commit, this is resolved for me. thanks! @Kodiologist if you like, you may install the updated lidR
source package from: https://r-lidar.r-universe.dev/lidR.
I opened this as rsbivand/rgrass#95 originally, but the rgrass guys think the problem is with lidR. I have no idea one way or the other.
I'm using: