arcpy.3d.LasDatasetToTin(in_las_dataset, out_tin, {thinning_type}, {thinning_method}, {thinning_value}, {max_nodes}, {z_factor}, {clip_to_extent})
|
名称
|
说明
|
数据类型
|
|
in_las_dataset
|
将要处理的 LAS 数据集。
|
LAS Dataset Layer
|
|
out_tin
|
将要生成的 TIN 数据集。
|
TIN
|
|
thinning_type
(可选)
|
指定将用于减少在生成 TIN 中保存为结点的 LAS 数据点的细化类型。
NONE—No thinning is applied. This is the default.
RANDOM—LAS data points will be randomly selected based on the thinning_method and thinning_value parameter values.
WINDOW_SIZE—The LAS dataset will be divided into square tiles defined by the thinning_value parameter value, and LAS points will be selected using the thinning_method parameter value.
|
String
|
|
thinning_method
(可选)
|
指定要用于减少 LAS 数据点的方法,该方法会影响 thinning_value 参数值的解释。 可用选项取决于 thinning_type 参数值。
PERCENT—The thinning value will reflect a percentage of the total points in the LAS dataset. This option is only available when thinning_type parameter value is RANDOM.
NODE_COUNT—The thinning value will reflect the total number of nodes that are allowed in the output. This option is only available when thinning_type parameter value is RANDOM.
MIN—Selects the LAS point with the lowest elevation in each window size area. This option is only available when thinning_type parameter value is WINDOW_SIZE.
MAX—Selects the LAS point with the highest elevation in each window size area. This option is only available when thinning_type parameter value is WINDOW_SIZE.
CLOSEST_TO_MEAN—Selects the LAS point with the elevation closest to the average value of all LAS points in each window size area. This option is only available when thinning_type parameter value is WINDOW_SIZE.
|
String
|
|
thinning_value
(可选)
|
细化值的解释取决于 thinning_type 参数值。
如果 thinning_type 参数值为 WINDOW_SIZE,则此值表示划分 LAS 数据集时依据的采样面积。
如果 thinning_type 参数值为 RANDOM 并且 thinning_method 参数值为 PERCENT,此值表示将从 LAS 数据集中导出到 TIN 的点百分比。
如果 thinning_type 参数值为 RANDOM 并且 thinning_method 参数值为 NODE_COUNT,此值表示可导出到 TIN 的总 LAS 点数。
|
Double
|
|
max_nodes
(可选)
|
输出 TIN 中允许的最大结点数。 默认值为 5 百万。
|
Double
|
|
z_factor
(可选)
|
Z 值将乘上的系数。 此值通常用于转换 z 线性单位来匹配 x,y 线性单位。 默认值为 1,此时高程值保持不变。 如果输入表面的空间参考具有已指定线性单位的 z 基准面,则此参数不可用。
|
Double
|
|
clip_to_extent
(可选)
|
指定是否将针对分析范围裁剪生成的 TIN。 仅当分析范围是输入 LAS 数据集的子集时,此选项才会生效。
|
Boolean
|
代码示例
LasDatasetToTin 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
arcpy.env.workspace = 'C:/data'
arcpy.ddd.LasDatasetToTin('se_baltimore.lasd', 'se_bmore', 'RANDOM', 15, 3.28)
LasDatasetToTin 示例 2(独立脚本)
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''**********************************************************************
Name: LAS Dataset to TIN Example
Description: Create a TIN using bare earth lidar measurements. This
script is designed for use as a script tool.
**********************************************************************'''
# Import system modules
import arcpy
# Set Local Variables
lasD = arcpy.GetParameterAsText(0)
inLas = arcpy.GetParameterAsText(1) #input las files
surfCons = arcpy.GetParameterAsText(2) #input surface constraints
sr = arcpy.GetParameter(3) #spatial reference of las dataset
outTin = arcpy.GetParameterAsText(4)
thinningType = arcpy.GetParameterAsText(5)
thinningMethod = arcpy.GetParameterAsText(6)
thinningValue = arcpy.GetParameter(7)
zFactor = arcpy.GetParameter(8)
# Run CreateLasDataset
arcpy.management.CreateLasDataset(inLas, lasD, 'RECURSION', surfCons, sr)
lasLyr = arcpy.CreateUniqueName('lasdToTin', 'in_memory')
classCode = 2
returnValue = 'LAST'
# Run MakeLasDatasetLayer
arcpy.management.MakeLasDatasetLayer(lasD, lasLyr, classCode, returnValue)
# Define extent of the area of interest
env.extent(1426057, 606477, 1449836, 623246)
# Run LasDatasetToTin
arcpy.ddd.LasDatasetToTin(lasLyr, outTin, thinningType,
thinningMethod, thinningValue, zFactor)