Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic detection with manual correction: CRS results in NA #614

Closed
Rpouliot opened this issue Aug 19, 2022 · 0 comments
Closed

Automatic detection with manual correction: CRS results in NA #614

Rpouliot opened this issue Aug 19, 2022 · 0 comments
Assignees
Labels
Enhancement Not actually a bug but a possible improvement

Comments

@Rpouliot
Copy link

Rpouliot commented Aug 19, 2022

When using the manual correction on an automatic tree detection, the CRS results in NA. The tree segmentation then results in error.

LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")

chm <- rasterize_canopy(las, 0.5, pitfree(subcircle = 0.2))
ttops <- locate_trees(las, lmf(ws = 5))
manual_ttops <- locate_trees(las, manual(ttops))

algo <- dalponte2016(chm, manual_ttops)
seg_las <- segment_trees(las, algo)
#> Error in geos_op2_geom("intersection", x, y, ...) : 
#>   st_crs(x) == st_crs(y) n'est pas TRUE
st_crs(manual_ttops)
#> Coordinate Reference System: NA
st_crs(ttops)
#> Coordinate Reference System:
#>  User input: EPSG:26912 

To work around this error, we can assign the st_crs(manual_ttops) <- st_crs(ttops). Then, these lines and the tree segmentation works fine:

algo <- dalponte2016(chm, manual_ttops)
seg_las <- segment_trees(las, algo)
@Jean-Romain Jean-Romain self-assigned this Aug 19, 2022
@Jean-Romain Jean-Romain added the Enhancement Not actually a bug but a possible improvement label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not actually a bug but a possible improvement
Projects
None yet
Development

No branches or pull requests

2 participants