r-lidar / lidR

Airborne LiDAR data manipulation and visualisation for forestry application
https://CRAN.R-project.org/package=lidR
GNU General Public License v3.0
596 stars 131 forks source link

Coordinate system error #586

Closed Jean-Romain closed 2 years ago

Jean-Romain commented 2 years ago

Discussed in https://github.com/r-lidar/lidR/discussions/585

Originally posted by **Phome95** May 21, 2022 Hello, I am attempting to use the silva2016 algorithm: ```r library(lidR) library(raster) chm <- raster("chm_clean2.tif") ttops <- locate_trees(chm, lmf(3)) crowns <- silva2016(chm, ttops)() ``` however this error comes up: ``` Error in geos_op2_geom("intersection", x, y, ...) : st_crs(x) == st_crs(y) is not TRUE ``` However both coordinate systems are the same. :link: [download data](https://drive.google.com/file/d/1pzQ3crlBwp3LS-vvqoPef8V_io1W-Iq5/view?usp=sharing)
Jean-Romain commented 2 years ago

Fixed

Phome95 commented 2 years ago

image Hi, I am still receiving the same error message?

Jean-Romain commented 2 years ago

Have you updated lidR?

Phome95 commented 2 years ago

yes, version 4.0.0

Jean-Romain commented 2 years ago

Version 4.0.0 is the one that have a bug. Latest version on CRAN is 4.0.1. Your bug has been fixed in 4.0.2 available here on github.

Phome95 commented 2 years ago

In the release section?

Jean-Romain commented 2 years ago

Nope, just the current state of the source code. You can install the package from the source code with

devtools::install_github("r-lidar/lidR")
Phome95 commented 2 years ago

It worked thank you!