LAS 转多点 (3D Analyst)
摘要
This tool imports one or more files in LAS format, the industry standard for lidar data, into a new multipoint feature class. Supported LAS file format versions are 1.0, 1.1, and 1.2.
用法
可将 LAS 点分成很多个类别,包括地面、裸露地表、冠层顶部和水域。使用数字整数代码定义不同的类。遗憾的是,LAS 1.0 规范不具有预定义的分类方案,文件也未汇总点使用了什么类代码(如果有的话)。您需要从数据提供程序中获得此信息。
如果您使用的是 LAS 1.1 或 1.2 规范,有关需要的数据类别,请参阅美国摄影测量及遥感协会 (ASPRS) 定义的预定义分类方案。下表列出了 ASPRS 定义的基于 LAS 版本 1.2 的 LAS 类代码。
若要从一个或多个 LAS 文件中导入预定义 LAS 点,可以在输入类代码参数中指定它们。
ASPRS 标准激光雷达点类类别值
含义
0
已创建,从未分类
1
未分类
2
地面
3
低植被
4
中等植被
5
高植被
6
建筑物
7
低点(噪点)
8
模型关键点(离散多点)
9
水域
10
为 ASPRS 定义预留
11
为 ASPRS 定义预留
12
重叠点
13-31
为 ASPRS 定义预留
-
支持的 LAS 版本有 1.0、1.1 和 1.2。
-
如果对基于返回数值导入点不感兴趣,或者由于已将点进行过滤或分类而将文件中指定的所有返回数值设置为 0,则选择 ANY_RETURN。
-
将多个 LAS 属性加载到 Oracle 数据库时,必须确保参数 attribute_binary 的所有 DBTUNE 关键字均设置为使用二进制大对象 (BLOB),而不是 LONGRAW。这是因为 LAS 属性已作为 BLOB 加载,而 Oracle 不支持 LONGRAW 表中存在多个 BLOB。如需帮助,请联系 Oracle 数据库管理员。
语法
参数 | 说明 | 数据类型 |
input |
One or more files or folders with data in the LAS version 1.0, 1.1, and 1.2 format. The LAS format is the industry standard for lidar data. | Folder; File |
out_feature_class |
The newly created multipoint feature class to which lidar points are added. | Feature Class |
average_point_spacing |
The average 2D distance between points in the input file or files. This can be an approximation. If areas have been sampled at different densities, specify the smaller spacing. The value needs to be provided in the projection units of the output coordinate system. | Double |
class_code (可选) |
Numeric classification codes to use as a query filter. The default is no filter. | Long |
return (可选) |
The return values used as a query filter. Valid return values are 1-5, LAST_RETURNS, and ANY_RETURNS. The default is ANY_RETURNS. | String |
attribute (可选) |
One or more LAS attributes to load and store and optionally the field names to use. The default is none. Supported attribute keywords are INTENSITY, RETURN_NUMBER, NUMBER_OF_RETURNS, SCAN_DIRECTION_FLAG, EDGE_OF_FLIGHTLINE, CLASSIFICATION, SCAN_ANGLE_RANK, FILE_MARKER, USER_BIT_FIELD, and GPS_TIME. | String |
input_coordinate_system (可选) |
The coordinate system of the input LAS file. This defaults to that specified in the LAS file. If for some reason it's not defined in the file but you know what it is, provide it here. | Coordinate system |
file_suffix (可选) |
The suffix of the files to import when a folder is specified on input. | String |
z_factor (可选) |
Specifies a factor by which to multiply the surface heights. Used to convert z units to x and y units. | Double |
代码示例
以下 Python 窗口脚本演示了如何在立即模式下使用 LAS 转多点函数。
import arcpy from arcpy import env arcpy.CheckOutExtension("3D") env.workspace = "C:/data" arcpy.LASToMultipoint_3d("001.las", "Test.gdb/feature_dataset/sample_1", 1.5, "2", "ANY_RETURNS", "INTENSITY", "Coordinate Systems"\ "/Projected Coordinate Systems/UTM/NAD 1983/NAD 1983 "\ "UTM Zone 17N.prj", "las", 1)
以下 Python 脚本演示了如何在独立脚本中使用 LAS 转多点函数。
'''**************************************************************************** Name: Define Data Boundary of LAS File Description: This script demonstrates how to delineate data boundaries of LAS files with irregularly clustered points. It is intended for use as a script tool with one input LAS file. ****************************************************************************''' # Import system modules import arcpy import exceptions, sys, traceback # Set local variables inLas = arcpy.GetParameterAsText(0) #input LAS file ptSpacing = arcpy.GetParameterAsText(1) # LAS point spacing classCode = arcpy.GetParameterAsText(2) # List of integers returnValue = arcpy.GetParameterAsText(3) # List of strings outTin = arcpy.GetParameterAsText(4) # TIN created to delineate data area outBoundary = arcpy.GetParameterAsText(5) # Polygon boundary file try: arcpy.CheckOutExtension("3D") # Execute LASToMultipoint arcpy.AddMessage("Creating multipoint features from LAS...") lasMP = arcpy.CreateUniqueName('lasMultipoint', 'in_memory') arcpy.ddd.LASToMultipoint(inLas, LasMP, ptSpacing, class_code, "ANY_RETURNS", "", sr, inFormat, zfactor) # Execute CreateTin arcpy.AddMessage("Creating TIN dataset...") arcpy.ddd.CreateTin(outTin, sr, "{0} Shape.Z masspoints"\ .format(lasMP), "Delaunay") # Execute CopyTin arcpy.AddMessage("Copying TIN to delineate data boundary...") arcpy.ddd.CopyTin(outTin, "{0}_copy".format(outTin)) # Execute DelineateTinDataArea arcpy.AddMessage("Delineating TIN boundary...") maxEdge = ptSpacing * 4 arcpy.ddd.DelineateTinDataArea(outTin, maxEdge, "PERIMETER_ONLY") # Execute TinDomain arcpy.AddMessage("Exporting data area to polygon boundary...") arcpy.ddd.TinDomain(outTin, outBoundary, "POLYGON") arcpy.AddMessage("Finished") arcpy.CheckInExtension("3D") except arcpy.ExecuteError: print arcpy.GetMessages() except: # Get the traceback object tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] # Concatenate error information into message string pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\ .format(tbinfo, str(sys.exc_info()[1])) msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2)) # Return python error messages for script tool or Python Window arcpy.AddError(pymsg) arcpy.AddError(msgs)