Creates a LASheader object either from a raw list containing all the elements named according to the rlas package or creates a header from a data.frame
or data.table containing a point cloud. In the latter case it will generate a header according to the data using rlas::header_create() . It will guess the LAS file format, the point data format, and initialize the scale factors and offsets, but these may not suit a user's needs. Users are advised to manually modify the results to fit their specific needs.
LASheader(data = list())
Arguments
data: a list containing the data from the header of a LAS file. Can also be a data.frame or data.table
Returns
An object of class LASheader
Examples
data = data.frame(X = c(339002.889,339002.983,339002.918), Y = c(5248000.515,5248000.478,5248000.318), Z = c(975.589,974.778,974.471), gpstime = c(269347.28141,269347.28142,269347.28143), Intensity = c(82L,54L,27L), ReturnNumber = c(1L,1L,2L), NumberOfReturns = c(1L,1L,2L), ScanDirectionFlag = c(1L,1L,1L), EdgeOfFlightline = c(1L,0L,0L), Classification = c(1L,1L,1L), ScanAngleRank = c(-21L,-21L,-21L), UserData = c(32L,32L,32L), PointSourceID = c(17L,17L,17L))header = LASheader(data)header
# Record an EPSG codeepsg(header)<-32618header
las <- LAS(data, header)las
# The function inferred a LAS 1.2 format 1 which is correct# Upgrade to LAS 1.4 for the exampleheader@VLR <- list()# Erase VLR previously writtenheader@PHB[["Global Encoding"]][["WKT"]]<-TRUEheader@PHB[["Version Minor"]]<-4Lheader@PHB[["Header Size"]]<-375Lheader@PHB[["Offset to point data"]]<-375Lwkt(header)<- sf::st_crs("EPSG:32618")$wkt
header
las1.4<- LAS(data, header)las1.4