Closed jakubchr closed 5 years ago
Well, in this particular example the message could be a warning. But you can find a workaround by removing the extrabytes from the header
las@header@VLR <- list()
Not to myself:
select
explicitly removes the extrabytes, readLAS
should also remove the extrabytes.Ok, it allows me to save but it seems like writeLAS ignores selection and filtering. It saves file with all attributes (beside xyzi)
writeLAS(las, "filtered_selected_las.las")
las_new = readLAS("filtered_selected_las.las")
and the summary for las new:
class : LAS (LASF v1.4)
point format : 7
memory : 397.9 Mb
extent :7497590, 7498410, 5788790, 5789610 (xmin, xmax, ymin, ymax)
coord. ref. : NA
area : 670422.1 units² (convex hull)
points : 4011573 points
density : 5.98 points/units²
names : X Y Z gpstime Intensity ReturnNumber NumberOfReturns ScanDirectionFlag EdgeOfFlightline Classification ScannerChannel Synthetic_flag Keypoint_flag Withheld_flag Overlap_flag ScanAngle UserData PointSourceID R G B
File signature: LASF
File source ID: 0
Project ID - GUID: 00000000-0000-0000-0000-000000000000
Version: 1.4
System identifier:
Generating software: rlas R package
File creation d/y: 0/2019
header size: 375
Offset to point data: 375
Num. var. length record: 0
Point data format: 7
Point data record length: 36
Num. of point records: 4011573
Num. of points by return:
Scale factor X Y Z: 0.01 0.01 0.01
Offset X Y Z: 0 0 0
min X Y Z: 7497590 5788790 -1.58
max X Y Z: 7498410 5789610 38.92
Variable length records: void
A las file contains all the attributes. What you can change is the point data record format. In your case a point format 0 might be used. See the las specifications. For a more comprehensive answer please ask on https://gis.stackexchange.com/. Obviously in your case the attributes are set to 0
Enhanced in lidR v2.1
library(lidR)
f <- system.file("extdata", "extra_byte.laz", package = "rlas")
las <- readLAS(f, select = "xyzi")
#> 'Amplitude' extrabytes attribute has been removed from the header because it has not been loaded.
#> 'Pulse width' extrabytes attribute has been removed from the header because it has not been loaded.
las <- readLAS(f, select = "xyzi1")
#> 'Pulse width' extrabytes attribute has been removed from the header because it has not been loaded.
Created on 2019-03-20 by the reprex package (v0.2.1)
lidR 2.0.2
LAS file summary:
Here's the code that I'm trying to run:
I receive error:
I would like to save such filtered and selected file. I don't know whether it is prohibited deliberately. Cheers! :)