arcpy.3d.UpdateFeatureZ(in_features, in_surface, {method}, {status_field})
|
名称
|
说明
|
数据类型
|
|
in_features
|
折点 z 值将被修改的 3D 要素。
|
Feature Layer
|
|
in_surface
|
将用于确定 3D 要素折点新 z 值的表面。
|
LAS Dataset Layer; Mosaic Layer; Raster Layer; TIN Layer
|
|
method
(可选)
|
用于确定表面相关信息的插值方法。 可用选项取决于输入表面的数据类型:
BILINEAR—An interpolation method exclusive to the raster surface, which determines cell values from the four nearest cells. This is the only option available for a raster surface.
LINEAR—Default interpolation method for a TIN, terrain, and LAS dataset. Obtains elevation from the plane defined by the triangle that contains the XY location of a query point.
NATURAL_NEIGHBORS—Obtains elevation by applying area-based weights to the natural neighbors of a query point.
CONFLATE_ZMIN—Obtains elevation from the smallest z-value found among the natural neighbors of a query point.
CONFLATE_ZMAX—Obtains elevation from the largest z-value found among the natural neighbors of a query point.
CONFLATE_NEAREST—Obtains elevation from the nearest value among the natural neighbors of a query point.
CONFLATE_CLOSEST_TO_MEAN—Obtains elevation from the z-value that is closest to the average of all the natural neighbors of a query point.
|
String
|
|
status_field
(可选)
|
将使用值进行填充的现有数值字段,可反映要素的折点是否已成功更新。 已更新要素的值会被指定为 1,而未更新要素的值会被指定为 0。 不会更新与表面部分重叠的要素。
|
Field
|
派生输出
|
名称
|
说明
|
数据类型
|
|
out_feature_class
|
折点 z 值已修改的更新后 3D 要素。
|
Feature Layer
|
代码示例
UpdateFeatureZ 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
import arcpy
arcpy.env.workspace = 'C:/data'
arcpy.ddd.UpdateFeatureZ('lines_3d.shp', 'dsm.tif', status_field='Updated')
UpdateFeatureZ 示例 2(独立脚本)。
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''****************************************************************************
Name: Update Antenna Positions
Description: Updates antenna positions based on elevations from a surface.
****************************************************************************'''
# Import system modules
import arcpy
in_fc = arcpy.GetParameterAsText(1) # pt features representing antenna locations
surface = arcpy.GetParameterAsText(2) # surface used to modify feature Z values
try:
if arcpy.Describe(surface).dataType in ('Raster', 'RasterLayer'):
method = 'BILINEAR'
else:
method = 'CONFLATE_ZMAX'
arcpy.ddd.UpdateFeatureZ(in_fc, surface, method)
except arcpy.ExecuteError:
print(arcpy.GetMessages())