Hello,
A few minutes I have updated the LASzip DLL to allow writing LAS and LAZ files (version 1.0 to 1.4) without a-priori knowledge of the bounding box or the point count.
I have added one new small code example (EXAMPLE_ELEVEN) to the laszipdllexample.cpp tutorial file that uses the DLL in various ways to show the sequence of DLL commands needed to get the DLL to update the header of the LAS / LAZ file once writing is complete.
Note that this means that you cannot create spatial indices on-the-fly but will have to do it in a separate call to lasindex because the spatial indexer needs a-priory bounding box information.
Regards,
Martin
------------------------------------------------------------------------
>> laszipdllexample.exe lalala.las labba.las
LASzip DLL v2.4 r1 (build 150923)
running EXAMPLE_ELEVEN (writing points to LAS 1.4 without a-priori knowlegde of bounding box or point count (compatibility only for LAZ))
offset_to_point_data before adding empty OGC WKT VLR is : 375
offset_to_point_data before adding funny VLR is : 429
offset_to_point_data after adding VLRs : 483
writing file 'labba.las' uncompressed
successfully written 5 points
total time: 0 sec for writing uncompressed
>> lasinfo labba.las
lasinfo report for labba.las
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 4711
global_encoding: 17
project ID GUID data 1-4: 00000000-0000-0000-0000-000000000000
version major.minor: 1.4
system identifier: 'LASzip DLL example 7'
generating software: 'LASzip DLL 2.4 r1 (150923)'
file creation day/year: 30/2015
header size: 375
offset to point data: 483
number var. length records: 2
point data format: 6
point data record length: 30
number of point records: 0
number of points by return: 0 0 0 0 0
scale factor x y z: 0.01 0.01 0.01
offset x y z: 0 0 0
min x y z: 630498.56 4834748.73 62.15
max x y z: 630499.95 4834749.66 63.68
start of waveform data packet record: 0
start of first extended variable length record: 0
number of extended_variable length records: 0
extended number of point records: 5
extended number of points by return: 1 2 0 0 0 0 0 1 1 0 0 0 0 0 0
variable length header record 1 of 2:
reserved 43707
user ID 'LASF_Projection'
record ID 2112
length after header 0
description 'intentionally empty OGC WKT'
variable length header record 2 of 2:
reserved 43707
user ID 'funny'
record ID 12345
length after header 0
description 'just a funny VLR'
reporting minimum and maximum for all LAS point record entries ...
X 63049856 63049995
Y 483474873 483474966
Z 6215 6368
intensity 20 110
return_number 1 7
number_of_returns 2 7
edge_of_flight_line 0 0
scan_direction_flag 0 0
classification 0 5
scan_angle_rank 21 23
user_data 0 0
point_source_ID 0 0
gps_time 53413162.560400 53413162.580200
extended_return_number 1 9
extended_number_of_returns 2 9
extended_classification 2 42
extended_scan_angle 3500 3767
extended_scanner_channel 1 1
number of first returns: 1
number of intermediate returns: 1
number of last returns: 3
number of single returns: 0
overview over extended number of returns of given pulse: 0 3 0 0 0 0 0 0 2 0 0 0 0 0 0
histogram of classification of points:
2 never classified (0)
2 ground (2)
1 high vegetation (5)
+-> flagged as extended overlap: 1
histogram of extended classification of points:
1 extended classification (41)
1 extended classification (42)
------------------------------------------------------------------------
>> laszipdllexample.exe lalala.las labba.laz
LASzip DLL v2.4 r1 (build 150923)
running EXAMPLE_ELEVEN (writing points to LAS 1.4 without a-priori knowlegde of bounding box or point count (compatibility only for LAZ))
offset_to_point_data before adding empty OGC WKT VLR is : 375
offset_to_point_data before adding funny VLR is : 429
offset_to_point_data after adding VLRs : 483
writing file 'labba.laz' compressed
successfully written 5 points
total time: 0 sec for writing compressed
>> lasinfo labba.laz
lasinfo report for labba.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 4711
global_encoding: 1
project ID GUID data 1-4: 00000000-0000-0000-0000-000000000000
version major.minor: 1.2
system identifier: 'LASzip DLL example 7'
generating software: 'LASzip DLL 2.4 r1 (150923)'
file creation day/year: 30/2015
header size: 227
offset to point data: 1367
number var. length records: 4
point data format: 1
point data record length: 33
number of point records: 5
number of points by return: 1 2 0 0 0
scale factor x y z: 0.01 0.01 0.01
offset x y z: 0 0 0
min x y z: 630498.56 4834748.73 62.15
max x y z: 630499.95 4834749.66 63.68
variable length header record 1 of 4:
reserved 43707
user ID 'LASF_Projection'
record ID 2112
length after header 0
description 'intentionally empty OGC WKT'
variable length header record 2 of 4:
reserved 43707
user ID 'funny'
record ID 12345
length after header 0
description 'just a funny VLR'
variable length header record 3 of 4:
reserved 43707
user ID 'lascompatible'
record ID 22204
length after header 156
description 'LASzip DLL 2.4 r1 (150923)'
variable length header record 4 of 4:
reserved 43707
user ID 'LASF_Spec'
record ID 4
length after header 768
description 'LASzip DLL 2.4 r1 (150923)'
Extra Byte Descriptions
data type: 4 (short), name "LAS 1.4 scan angle", description: "additional attributes", scale: 0.006, offset: 0 (not set)
data type: 1 (unsigned char), name "LAS 1.4 extended returns", description: "additional attributes", scale: 1 (not set), offset: 0 (not set)
data type: 1 (unsigned char), name "LAS 1.4 classification", description: "additional attributes", scale: 1 (not set), offset: 0 (not set)
data type: 1 (unsigned char), name "LAS 1.4 flags and channel", description: "additional attributes", scale: 1 (not set), offset: 0 (not set)
LASzip compression (version 2.4r1 c2 50000): POINT10 2 GPSTIME11 2 BYTE 2
reporting minimum and maximum for all LAS point record entries ...
X 63049856 63049995
Y 483474873 483474966
Z 6215 6368
intensity 20 110
return_number 1 7
number_of_returns 2 7
edge_of_flight_line 0 0
scan_direction_flag 0 0
classification 0 5
scan_angle_rank 21 22
user_data 0 0
point_source_ID 0 0
gps_time 53413162.560400 53413162.580200
number of first returns: 1
number of intermediate returns: 1
number of last returns: 3
number of single returns: 0
WARNING: there is 1 point with return number 6
WARNING: there is 1 point with return number 7
overview over number of returns of given pulse: 0 3 0 0 0 0 2
histogram of classification of points:
2 never classified (0)
2 ground (2)
1 high vegetation (5)