arcpy.3d.LasPointStatsByArea(in_las_dataset, in_features, out_property)
|
名称
|
说明
|
数据类型
|
|
in_las_dataset
|
将要处理的 LAS 数据集。
|
LAS Dataset Layer
|
|
in_features
|
用于定义将要为其报告统计数据的区域的面。
|
Feature Layer
|
|
out_property
[out_property,...]
|
要计算的属性。
Z_MIN—The lowest Z value of LAS points overlapping the feature.
Z_MAX—The highest Z value of LAS points overlapping the feature.
Z_MEAN—The average Z value of LAS points overlapping the feature.
POINT_COUNT—The tally of LAS points that were evaluated.
STANDARD_DEVIATION—The standard deviation of Z values.
|
String
|
派生输出
|
名称
|
说明
|
数据类型
|
|
output_polygons
|
更新后的输入面要素。
|
Feature Class
|
代码示例
LasPointStatsByArea 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
import arcpy
from arcpy import env
env.workspace = 'C:/data'
arcpy.ddd.LasPointStatsByArea('city_lidar.lasd', 'study_area.shp',
['Z_MIN', 'Z_MAX'])
LasPointStatsByArea 示例 2(独立脚本)
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''****************************************************************************
Name: Extract Building Footprints
Description: Extract footprint from lidar points classified as buildings,
regularize its geometry, and calculate the building height.
****************************************************************************'''
import arcpy
lasd = arcpy.GetParameterAsText(0)
footprint = arcpy.GetParameterAsText(1)
try:
lasd_layer = 'building points'
arcpy.management.MakeLasDatasetLayer(lasd, lasd_layer, class_code=6)
temp_raster = 'in_memory/bldg_raster'
arcpy.management.LasPointStatsAsRaster(lasd_layer, temp_raster,
'PREDOMINANT_CLASS', 'CELLSIZE', 2.5)
temp_footprint = 'in_memory/footprint'
arcpy.conversion.RasterToPolygon(temp_raster, temp_footprint)
arcpy.ddd.RegularizeBuildingFootprint(temp_footprint, footprint,
method='RIGHT_ANGLES')
arcpy.ddd.LasPointStatsByArea(lasd_layer, footprint, ['MIN_Z', 'MAX_Z'])
arcpy.management.AddField(footprint, 'Height', 'Double')
arcpy.management.CalculateField(footprint, 'Height',
"round('!Z_Max! - !Z_Min!', 2)",
'PYTHON_9.3')
except arcpy.ExecuteError:
print(arcpy.GetMessages())