LAS Dataset Layer; Mosaic Layer; Raster Layer; Terrain Layer; TIN Layer; Image Service
输入要素
将要处理的输入要素。
Feature Layer
输出要素类
将生成的要素类。
Feature Class
采样距离
(可选)
用于内插 z 值的间距。 默认情况下,该参数是栅格数据集的像元大小或三角化网格面的自然增密。
Double
Z 因子
(可选)
Z 值将乘上的系数。 此值通常用于转换 z 线性单位来匹配 x,y 线性单位。 默认值为 1,此时高程值保持不变。 如果输入表面的空间参考具有已指定线性单位的 z 基准面,则此参数不可用。
Double
方法
(可选)
指定将用于确定输出要素的高程值的插值方法。 可用选项取决于表面类型。
Bilinear—The value of the query point will be determined using bilinear interpolation. This is the default when the input is a raster surface.
Nearest Neighbor—The value of the query point will be determined using nearest neighbor interpolation. With this method, surface values will only be interpolated for the input feature's vertices. This option is only available for a raster surface.
Linear—Elevation values will be obtained from the plane defined by the triangle that contains the x,y-location of a query point. This is the default interpolation method for TIN, terrain, and LAS datasets.
Natural Neighbors—Elevation values will be obtained by applying area-based weights to the natural neighbors of a query point.
Conflate Minimum Z—Elevation values will be obtained from the smallest z-value found among the natural neighbors of a query point.
Conflate Maximum Z—Elevation values will be obtained from the largest z-value found among the natural neighbors of a query point.
Conflate Nearest Z—Elevation values will be obtained from the nearest value among the natural neighbors of a query point.
Conflate Z Closest To Mean—Elevation values will be obtained from the z-value that is closest to the average of all the natural neighbors of a query point.
String
仅插值折点
(可选)
指定是否仅沿输入要素的折点进行插值,并忽略采样距离选项。
选中—Interpolation will only occur along the vertices.
未选中—Interpolation will occur using the sampling distance. This is the default.
选中—Each vertex that falls outside the raster surface will have its z-value derived from the trend of z-values calculated for the vertices within the raster surface and will be retained in the output.
未选中—Features with at least one vertex that falls outside the raster surface will be skipped in the output. This is the default.
Boolean
对增密折点进行 m 值插值
(可选)
指定是否对通过增密添加的线和面折点的 m 值,从原始输入折点进行插值。
如果应用,则将沿两个具有 m 值的现有折点之间的原始线段对增密折点进行 m 值插值。 如果任一原始折点缺失 m 值,则沿该线段的所有新添加折点的 m 值均设置为 NaN。
选中—The m-values for densified vertices will be interpolated.
未选中—The m-values for densified vertices will not be interpolated. This is the default.
LAS Dataset Layer; Mosaic Layer; Raster Layer; Terrain Layer; TIN Layer; Image Service
in_feature_class
将要处理的输入要素。
Feature Layer
out_feature_class
将生成的要素类。
Feature Class
sample_distance
(可选)
用于内插 z 值的间距。 默认情况下,该参数是栅格数据集的像元大小或三角化网格面的自然增密。
Double
z_factor
(可选)
Z 值将乘上的系数。 此值通常用于转换 z 线性单位来匹配 x,y 线性单位。 默认值为 1,此时高程值保持不变。 如果输入表面的空间参考具有已指定线性单位的 z 基准面,则此参数不可用。
Double
method
(可选)
指定将用于确定输出要素的高程值的插值方法。 可用选项取决于表面类型。
BILINEAR—The value of the query point will be determined using bilinear interpolation. This is the default when the input is a raster surface.
NEAREST—The value of the query point will be determined using nearest neighbor interpolation. With this method, surface values will only be interpolated for the input feature's vertices. This option is only available for a raster surface.
LINEAR—Elevation values will be obtained from the plane defined by the triangle that contains the x,y-location of a query point. This is the default interpolation method for TIN, terrain, and LAS datasets.
NATURAL_NEIGHBORS—Elevation values will be obtained by applying area-based weights to the natural neighbors of a query point.
CONFLATE_ZMIN—Elevation values will be obtained from the smallest z-value found among the natural neighbors of a query point.
CONFLATE_ZMAX—Elevation values will be obtained from the largest z-value found among the natural neighbors of a query point.
CONFLATE_NEAREST—Elevation values will be obtained from the nearest value among the natural neighbors of a query point.
CONFLATE_CLOSEST_TO_MEAN—Elevation values will be obtained from the z-value that is closest to the average of all the natural neighbors of a query point.
String
vertices_only
(可选)
指定是否仅沿输入要素的折点进行插值,并忽略采样距离选项。
VERTICES_ONLY—Interpolation will only occur along the vertices.
DENSIFY—Interpolation will occur using the sampling distance. This is the default.
PRESERVE—Each vertex that falls outside the raster surface will have its z-value derived from the trend of z-values calculated for the vertices within the raster surface and will be retained in the output.
EXCLUDE—Features with at least one vertex that falls outside the raster surface will be skipped in the output. This is the default.
Boolean
interpolate_m_value
(可选)
指定是否对通过增密添加的线和面折点的 m 值,从原始输入折点进行插值。
如果应用,则将沿两个具有 m 值的现有折点之间的原始线段对增密折点进行 m 值插值。 如果任一原始折点缺失 m 值,则沿该线段的所有新添加折点的 m 值均设置为 NaN。
INTERPOLATE_M_VALUE—The m-values for densified vertices will be interpolated.
NO_INTERPOLATE_M_VALUE—The m-values for densified vertices will not be interpolated. This is the default.
'''*********************************************************************
Name: InterpolateShape Example
Description: This script demonstrates how to use InterpolateShape
on all 2D features in a target workspace.
*********************************************************************'''
# Import system modules
import arcpy
# Set local variables
inWorkspace = arcpy.GetParameterAsText(0)
surface = arcpy.GetParameterAsText(1)
try:
# Set default workspace
arcpy.env.workspace = inWorkspace
# Create list of feature classes in target workspace
fcList = arcpy.ListFeatureClasses()
if fcList:
for fc in fcList:
desc = arcpy.Describe(fc)
# Find 2D features
if not desc.hasZ:
# Set Local Variables
outFC = "{0}_3D.shp".format(desc.basename)
method = "BILINEAR"
# Run InterpolateShape
arcpy.ddd.InterpolateShape(surface, fc, outFC,
10, 1, method, True)
else:
print("{0} is not a 2D feature.".format(fc))
else:
print("No feature classes were found in {0}.".format(env.workspace))
except arcpy.ExecuteError:
print(arcpy.GetMessages())
except Exception as err:
print(err)