r-lidar / rlas

R package to read and write las and laz files used to store LiDAR data
https://cran.r-project.org/package=rlas
GNU General Public License v3.0
34 stars 14 forks source link

File Creation Day of Year is zeroed by write.las #51

Closed Jean-Romain closed 3 years ago

Jean-Romain commented 3 years ago
library(rlas)

lasfile <- system.file("extdata", "example.las", package="rlas")

lashead <- read.lasheader(lasfile)
lasdata <- read.las(lasfile)

lashead[["File Creation Year"]] <- as.numeric(format(Sys.time(), "%Y"))
lashead[["File Creation Day of Year"]] <- as.numeric(format(Sys.time(), "%j"))

f = tempfile(fileext = ".las")

write.las(f, lashead, lasdata)

lashead <- read.lasheader(f)
lashead[["File Creation Year"]]
#> [1] 2021
lashead[["File Creation Day of Year"]]
#> [1] 0

Created on 2021-03-10 by the reprex package (v1.0.0)