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
587 stars 132 forks source link

NumberOfReturns only support 3 bits #686

Closed bbrede closed 1 year ago

bbrede commented 1 year ago

I have a problem creating LAS objects with more than 8 returns. LAS v1.4 should support up to 15 returns, but this code: data <- data.frame(X = runif(100, 0, 100), Y = runif(100, 0, 100), Z = runif(100, 0, 20), NumberOfReturns = rep(15L, 100)) LAS(data) returns: Error: Invalid data: NumberOfReturns is not an unsigned integer on 3 bits

bbrede commented 1 year ago

I realised LAS() produces by default v1.2 las specification format. Is there a way to choose v1.4?

Jean-Romain commented 1 year ago

For referencement: https://gis.stackexchange.com/questions/461921/create-las-v1-4-from-scratch