对于一种数据格式的分析: las (laser file) , 基于asprs组织制定的雷达扫描格式.

访问量: 482

最近可能会有一个 相关的项目, 所以我们对它做了一定的研究. 

参考:  http://www.liblas.org/tutorial/python.html  以及:  http://www.asprs.org/wp-content/uploads/2010/12/LAS_1_4_r13.pdf

liblas: 使用的第三方工具:  http://www.liblas.org/start.html

las 文件, 也叫 laser file, 专门记录雷达扫描的结果.  

格式上,

有5 种:  1.0,  1.1 , 1.2 , 1.3, 1.4 .  

point

每个las 格式的文件, 都由多个point(点)做成,  point的格式有10种

所以,在分析之前,务必知道,这个文件的 格式是什么, 文件中的point的格式是什么.

每个point 

有 x,y,z 三个维度的坐标

有 intensity (照射的强度)

return number  第几批数据 

number to return  总共几批数据.

scan direction: 扫描的方向 

flight line edge: 飞行路线的角度.

time: 扫描时间

color ( red, green, blue) 总共三种. 

下面是一个例子:

>>> p.x, p.y, p.z
(289814.15000000002, 4320978.6100000003, 170.75999999999999)

>>> p.scan_angle
0
>>> p.scan_direction
0
>>> p.return_number
0   (0 of 2  中的 0) 
>>> p.number_of_returns
6   (0 of 6 中的 6)
>>> p.flightline_edge
0
>>> p.classification
2
>>> p.time
datetime.datetime(1970, 1, 6, 12, 44, 10, 1)

>>> p.intensity
120

>>> c = p.color
>>> c.red
255
>>> c.blue
255
>>> c.green
255

下面是详细的point

Table 7: Point Data Record Format 0
Item Format Size Required
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 *
Number of Returns (given pulse) 3 bits (bits 3 – 5) 3 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 char 1 byte *
User Data unsigned char 1 byte
Point Source ID unsigned short 2 bytes *

X, Y, and Z: The X, Y, and Z values are stored as long integers. The X, Y, and Z values are
used in conjunction with the scale values and the offset values to determine the coordinate for
each point as described in the Public Header Block section.
Intensity: The intensity value is the integer representation of the pulse return magnitude. This
value is optional and system specific. However, it should always be included if available.
Intensity, when included, is always normalized to a 16 bit, unsigned value by multiplying the value
by 65,536/(intensity dynamic range of the sensor). For example, if the dynamic range of the
sensor is 10 bits, the scaling value would be (65,536/1,024). If intensity is not included, this value
must be set to zero. This normalization is required to ensure that data from different sensors can
be correctly merged.
Please note that the following four fields (Return Number, Number of Returns, Scan Direction
Flag and Edge of Flight Line) are bit fields within a single byte.
Return Number: The Return Number is the pulse return number for a given output pulse. A given
output laser pulse can have many returns, and they must be marked in sequence of return. The
first return will have a Return Number of one, the second a Return Number of two, and so on up
to five returns.
Number of Returns (given pulse): The Number of Returns is the total number of returns for a
given pulse. For example, a laser data point may be return two (Return Number) within a total
number of five returns.
Scan Direction Flag: The Scan Direction Flag denotes the direction at which the scanner mirror
was traveling at the time of the output pulse. A bit value of 1 is a positive scan direction, and a bit
value of 0 is a negative scan direction (where positive scan direction is a scan moving from the
left side of the in-track direction to the right side and negative the opposite).
Edge of Flight Line: The Edge of Flight Line data bit has a value of 1 only when the point is at
the end of a scan. It is the last point on a given scan line before it changes direction.
Classification: This field represents the “class” attributes of a point. If a point has never been
classified, this byte must be set to zero. The format for classification is a bit encoded field with the
lower five bits used for the class and the three high bits us

订阅/RSS Feed

Subscribe

分类/category