LAS文件格式
LAS文件是二进制格式,其标准格式由美国摄影测量与遥感学会(ASPRS)的 LiDAR 专业委员会进行发布,最新的版本为 2019 年 7 月发布的 LAS 1.4 - R15。LAS1.4 版本的文件结构可分为 4 部分,包括公共头文件区、变长记录区、点数据记录区和扩展变长记录区。下面简要介绍LAS文件各部分编码格式。
公共头文件区
公共头文件区记载数据点的数量、格式、数据范围、变长记录区数量、点云数据真实坐标的 X、Y、Z方向的比例因子和偏移量等 LAS 文件的基本信息,所有项目需填写数据,若无数据则置零。下表为 LAS 1.0 - 1.4 R15公共头文件区的对比。
Item | LAS 1.0 | LAS 1.1 | LAS 1.2 | LAS 1.3 R11 | LAS 1.4 R15 | Format | Size |
---|---|---|---|---|---|---|---|
File Signature (“LASF”) | √ | √ | √ | √ | √ | char[4] | 4 bytes |
File Source ID | 保留字节,置零 | √ | √ | √ | √ | unsigned short | 2 bytes |
Global Encoding | 保留字节,置零 | 保留字节,置零 | √ | √ | √ | unsigned short | 2 bytes |
Project ID - GUID Data 1 | √ | √ | √ | √ | √ | unsigned long | 4 bytes |
Project ID - GUID Data 2 | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Project ID - GUID Data 3 | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Project ID - GUID Data 4 | √ | √ | √ | √ | √ | unsigned char[8] | 8 bytes |
Version Major | √ | √ | √ | √ | √ | unsigned char | 1 byte |
Version Minor | √ | √ | √ | √ | √ | unsigned char | 1 byte |
System Identifier | √ | √ | √ | √ | √ | char[32] | 32 bytes |
Generating Software | √ | √ | √ | √ | √ | char[32] | 32 bytes |
File Creation Day of Year | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
File Creation Year | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Header Size | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Offset to Point Data | √ | √ | √ | √ | √ | unsigned long | 4 bytes |
Number of Variable Length Records | √ | √ | √ | √ | √ | unsigned long | 4 bytes |
Point Data Record Format | √ | √ | √ | √ | √ | unsigned char | 1 byte |
Point Data Record Length | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Legacy Number of Point Records | √ | √ | √ | √ | √ | unsigned long | 4 bytes |
Legacy Number of Point by Return | √ | √ | √ | √ | √ | unsigned long[5] | 20 bytes |
X Scale Factor | √ | √ | √ | √ | √ | double | 8 bytes |
Y Scale Factor | √ | √ | √ | √ | √ | double | 8 bytes |
Z Scale Factor | √ | √ | √ | √ | √ | double | 8 bytes |
X Offset | √ | √ | √ | √ | √ | double | 8 bytes |
Y Offset | √ | √ | √ | √ | √ | double | 8 bytes |
Z Offset | √ | √ | √ | √ | √ | double | 8 bytes |
Max X | √ | √ | √ | √ | √ | double | 8 bytes |
Min X | √ | √ | √ | √ | √ | double | 8 bytes |
Max Y | √ | √ | √ | √ | √ | double | 8 bytes |
Min Y | √ | √ | √ | √ | √ | double | 8 bytes |
Max Z | √ | √ | √ | √ | √ | double | 8 bytes |
Min Z | √ | √ | √ | √ | √ | double | 8 bytes |
Start of Waveform Data Packet Record | √ | √ | unsigned long long | 8 bytes | |||
Start of First Extended Variable Length Record | √ | unsigned long long | 8 bytes | ||||
Number of Extended Variable Length Records | √ | unsigned long | 4 bytes | ||||
Number of Point Records | √ | unsigned long long | 8 bytes | ||||
Number of Points by Return | √ | unsigned long long[15] | 120 bytes |
点数据记录区
点数据记录区位于变长记录区之后,主要用于存储点云数据,包括每个激光点的三维坐标信息、回波强度信息等相关属性,是 LAS 文件的核心。在 LAS 1.4 版本中,有 11 种点数据类型。点数据类型在公共头文件区中已经指定,每个 LAS 文件只有 1 种点数据类型。LAS 1.0 - 1.3 仅包含 0 - 5 共 6 种点数据类型,LAS 1.4 R15 包含 0 - 10 共11 种点数据类型。下表为 0 - 10 点数据类型的对比。
Item | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Format | Size |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
X | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | long | 4 bytes |
Y | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | long | 4 bytes |
Z | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | long | 4 bytes |
Intensity | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
Return Number | √ | √ | √ | √ | √ | √ | 3 bits (bits 0-2) | 3 bits | |||||
Return Number | √ | √ | √ | √ | √ | 4 bits (bits 0-3) | 4 bits | ||||||
Number of Returns (Given Pulse) | √ | √ | √ | √ | √ | √ | 3 bits (bits 3-5) | 3 bits | |||||
Number of Returns (Given Pulse) | √ | √ | √ | √ | √ | 4 bits (bits 4-7) | 4 bits | ||||||
Classification Flags | √ | √ | √ | √ | √ | 4 bits (bits 0-3) | 4 bits | ||||||
Scanner Channel | √ | √ | √ | √ | √ | 2 bits (bits 4-5) | 2 bits | ||||||
Scan Direction Flag | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | 1 bit (bit 6) | 1 bit |
Edge of Flight Line | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | 1 bit (bit 7) | 1 bit |
Classification | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | unsigned char | 1 byte |
Scan Angle Rank (-90 to +90) – Left Side | √ | √ | √ | √ | √ | √ | signed char | 1 byte | |||||
User Data | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | unsigned char | 1 byte |
Scan Angle | √ | √ | √ | √ | √ | short | 2 bytes | ||||||
Point Source ID | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | unsigned short | 2 bytes |
GPS Time | √ | √ | √ | √ | √ | √ | √ | √ | √ | double | 8 bytes | ||
Red | √ | √ | √ | √ | √ | √ | unsigned short | 2 bytes | |||||
Green | √ | √ | √ | √ | √ | √ | unsigned short | 2 bytes | |||||
Blue | √ | √ | √ | √ | √ | √ | unsigned short | 2 bytes | |||||
Wave Packet Descriptor Index | √ | √ | √ | √ | unsigned char | 1 byte | |||||||
Byte Offset to Waveform Data | √ | √ | √ | √ | unsigned long long | 8 bytes | |||||||
Waveform Packet Size in Bytes | √ | √ | √ | √ | unsigned long | 4 bytes | |||||||
Return Point Waveform Location | √ | √ | √ | √ | float | 4 bytes | |||||||
Parametric dx | √ | √ | √ | √ | float | 4 bytes | |||||||
Parametric dy | √ | √ | √ | √ | float | 4 bytes | |||||||
Parametric dz | √ | √ | √ | √ | float | 4 bytes | |||||||
NIR | √ | √ | unsigned short | 2 bytes |
下表为 LAS 1.0 - 1.4 R15 可以使用的点数据类型。
版本 | 点数据类型 |
---|---|
LAS 1.0、1.1、1.2、1.3 R11 | 0、1、2、3、4、5 |
LAS 1.4 R15 | 0、1、2、3、4、5、6、7、8、9、10 |
下表为 0 - 10 点数据类型的最小尺寸。
类型 | 最小尺寸 | 类型 | 最小尺寸 | 类型 | 最小尺寸 |
---|---|---|---|---|---|
0 | 20 bytes | 4 | 57 bytes | 8 | 38 bytes |
1 | 28 bytes | 5 | 63 bytes | 9 | 59 bytes |
2 | 26 bytes | 6 | 30 bytes | 10 | 67 bytes |
3 | 34 bytes | 7 | 36 bytes |