1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
====================
What is a LAS file ?
====================
LAS is a public file format meant to exchange 3D point data, mostly used to exchange lidar point clouds.
LAZ is a **lossless** compression of the LAS format.
The latest LAS specification is the `LAS 1.4`_. laspy supports LAS files from Version 1.2 to 1.4.
.. _LAS 1.4: https://www.asprs.org/wp-content/uploads/2010/12/LAS_1_4_r13.pdf
LAS files are organized in 3 main parts:
1) Header
2) VLRs
3) Point Records
Header
------
The header contains information about the data such as its version, the point format (which tells the different
dimensions stored for each points).
See :ref:`accessing_header`
VLRs
----
After the header, LAS files may contain VLRs (Variable Length Record).
VLRs are meant to store additional information such as the SRS (Spatial Reference System),
description on extra dimensions added to the points.
VLRs are divided in two parts:
1) header
2) payload
The payload is limited to 65,535 bytes (Because in the header, the length of the payload is stored on a uint16).
See :ref:`manipulating_vlrs`
Point Records
-------------
The last chunk of data (and the biggest one) contains the point records. In a LAS file, points are stored sequentially.
The point records holds the point cloud data the LAS Spec specifies 10 point formats.
A point format describe the dimensions stored for each point in the record.
Each LAS specification added new point formats, the table below describe the compatibility between point formats
and LAS file version.
+-----------------+-----------------------------------+
|LAS file version + Compatible point formats |
+=================+===================================+
|1.2 | 0, 1, 2, 3 |
+-----------------+-----------------------------------+
|1.3 | 0, 1, 2, 3, 4, 5 |
+-----------------+-----------------------------------+
|1.4 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
+-----------------+-----------------------------------+
The names written in the tables below are the one you will have to use in
your code.
.. note::
The dimensions 'X', 'Y', 'Z' are signed integers without the scale and
offset applied. To access the coordinates as doubles simply use 'x', 'y' , 'z'
Point Format 0
++++++++++++++
+----------------------+-----------+--------------+
| Dimensions | Type | Size (bit) |
+======================+===========+==============+
| X | signed | 32 |
+----------------------+-----------+--------------+
| Y | signed | 32 |
+----------------------+-----------+--------------+
| Z | signed | 32 |
+----------------------+-----------+--------------+
| intensity | unsigned | 16 |
+----------------------+-----------+--------------+
| return_number | unsigned | 3 |
+----------------------+-----------+--------------+
| number_of_returns | unsigned | 3 |
+----------------------+-----------+--------------+
| scan_direction_flag | bool | 1 |
+----------------------+-----------+--------------+
| edge_of_flight_line | bool | 1 |
+----------------------+-----------+--------------+
| classification | unsigned | 5 |
+----------------------+-----------+--------------+
| synthetic | bool | 1 |
+----------------------+-----------+--------------+
| key_point | bool | 1 |
+----------------------+-----------+--------------+
| withheld | bool | 1 |
+----------------------+-----------+--------------+
| scan_angle_rank | signed | 8 |
+----------------------+-----------+--------------+
| user_data | unsigned | 8 |
+----------------------+-----------+--------------+
| point_source_id | unsigned | 8 |
+----------------------+-----------+--------------+
The point formats 1, 2, 3, 4, 5 are based on the point format 0, meaning that they have
the same dimensions plus some additional dimensions:
Point Format 1
++++++++++++++
+----------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+======================+===========+==============+
| gps_time | Floating | 64 |
+----------------------+-----------+--------------+
Point Format 2
++++++++++++++
+----------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+======================+===========+==============+
| red | unsigned | 16 |
+----------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------+-----------+--------------+
Point Format 3
++++++++++++++
+----------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+======================+===========+==============+
| gps_time | Floating | 64 |
+----------------------+-----------+--------------+
| red | unsigned | 16 |
+----------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------+-----------+--------------+
Point Format 4
++++++++++++++
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| gps_time | Floating | 64 |
+----------------------------+-----------+--------------+
| wavepacket_index | unsigned | 8 |
+----------------------------+-----------+--------------+
| wavepacket_offset | unsigned | 64 |
+----------------------------+-----------+--------------+
| wavepacket_size | unsigned | 32 |
+----------------------------+-----------+--------------+
| return_point_wave_location | floating | 32 |
+----------------------------+-----------+--------------+
| x_t | floating | 32 |
+----------------------------+-----------+--------------+
| y_t | floating | 32 |
+----------------------------+-----------+--------------+
| z_t | floating | 32 |
+----------------------------+-----------+--------------+
Point Format 5
++++++++++++++
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| gps_time | Floating | 64 |
+----------------------------+-----------+--------------+
| red | unsigned | 16 |
+----------------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------------+-----------+--------------+
| wavepacket_index | unsigned | 8 |
+----------------------------+-----------+--------------+
| wavepacket_offset | unsigned | 64 |
+----------------------------+-----------+--------------+
| wavepacket_size | unsigned | 32 |
+----------------------------+-----------+--------------+
| return_point_wave_location | unsigned | 32 |
+----------------------------+-----------+--------------+
| x_t | floating | 32 |
+----------------------------+-----------+--------------+
| y_t | floating | 32 |
+----------------------------+-----------+--------------+
| z_t | floating | 32 |
+----------------------------+-----------+--------------+
Point Format 6
++++++++++++++
The Point Format 6, is the new base point format (6, 7, 8, 9, 10) introduced in the LAS specification 1.4.
The main modifications from point format 0 and point format 6 are that now the gps_time is baseline
and some fields takes more bits, for example the classification is now stored on 8 bits (previously 5).
+----------------------+-----------+--------------+
| Dimensions | Type | Size (bit) |
+======================+===========+==============+
| X | signed | 32 |
+----------------------+-----------+--------------+
| Y | signed | 32 |
+----------------------+-----------+--------------+
| Z | signed | 32 |
+----------------------+-----------+--------------+
| intensity | unsigned | 16 |
+----------------------+-----------+--------------+
| return_number | unsigned | 4 |
+----------------------+-----------+--------------+
| number_of_returns | unsigned | 4 |
+----------------------+-----------+--------------+
| synthetic | bool | 1 |
+----------------------+-----------+--------------+
| key_point | bool | 1 |
+----------------------+-----------+--------------+
| withheld | bool | 1 |
+----------------------+-----------+--------------+
| overlap | bool | 1 |
+----------------------+-----------+--------------+
| scanner_channel | unsigned | 2 |
+----------------------+-----------+--------------+
| scan_direction_flag | bool | 1 |
+----------------------+-----------+--------------+
| edge_of_flight_line | bool | 1 |
+----------------------+-----------+--------------+
| classification | unsigned | 8 |
+----------------------+-----------+--------------+
| user_data | unsigned | 8 |
+----------------------+-----------+--------------+
| scan_angle | signed | 16 |
+----------------------+-----------+--------------+
| point_source_id | unsigned | 8 |
+----------------------+-----------+--------------+
| gps_time | Floating | 64 |
+----------------------+-----------+--------------+
Point Format 7
++++++++++++++
Add RGB to point format 6.
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| red | unsigned | 16 |
+----------------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------------+-----------+--------------+
Point Format 8
++++++++++++++
Adds RGB and Nir (Near Infrared) to point format 6.
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| red | unsigned | 16 |
+----------------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------------+-----------+--------------+
| nir | unsigned | 16 |
+----------------------------+-----------+--------------+
Point Format 9
++++++++++++++
Add waveform data to points
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| wavepacket_index | unsigned | 8 |
+----------------------------+-----------+--------------+
| wavepacket_offset | unsigned | 64 |
+----------------------------+-----------+--------------+
| wavepacket_size | unsigned | 32 |
+----------------------------+-----------+--------------+
| return_point_wave_location | unsigned | 32 |
+----------------------------+-----------+--------------+
| x_t | floating | 32 |
+----------------------------+-----------+--------------+
| y_t | floating | 32 |
+----------------------------+-----------+--------------+
| z_t | floating | 32 |
+----------------------------+-----------+--------------+
Point Format 10
+++++++++++++++
Adds RGB, Nir (near infrared), waveform data to point format 6
+----------------------------+-----------+--------------+
| Added dimensions | Type | Size (bit) |
+============================+===========+==============+
| red | unsigned | 16 |
+----------------------------+-----------+--------------+
| green | unsigned | 16 |
+----------------------------+-----------+--------------+
| blue | unsigned | 16 |
+----------------------------+-----------+--------------+
| nir | unsigned | 16 |
+----------------------------+-----------+--------------+
| wavepacket_index | unsigned | 8 |
+----------------------------+-----------+--------------+
| wavepacket_offset | unsigned | 64 |
+----------------------------+-----------+--------------+
| wavepacket_size | unsigned | 32 |
+----------------------------+-----------+--------------+
| return_point_wave_location | unsigned | 32 |
+----------------------------+-----------+--------------+
| x_t | floating | 32 |
+----------------------------+-----------+--------------+
| y_t | floating | 32 |
+----------------------------+-----------+--------------+
| z_t | floating | 32 |
+----------------------------+-----------+--------------+
EVLRs
-----
Version 1.4 of the LAS specification added a last block following the point records: EVLRs (Extended Variable
Length Record) which are the same thing as VLRs but they can carry a higher payload (length of the payload is stored
on a uint64)
|