シェープの内挿 (3D Analyst)
サマリ
ラスタ、TIN、またはテレイン データセットから得られる標高に基づいて、フィーチャクラスの Z 値を内挿します。
図
![]() |
使用法
-
Natural Neighbors 内挿法オプションを使用する場合には、必ず十分なサンプル距離を指定するようにします。通常この値は、TIN またはテレイン データセットの構築に使用するデータの平均ポイント間隔の 0.5 倍から 1.0 倍の間になります。
-
[頂点のみを内挿] オプションを使用すると、サーフェスのデータ領域外に存在する頂点を含む入力フィーチャは無視され、出力されません。[シェープの内挿(Interpolate Shape)] を実行する前にフィーチャをクリップして、フィーチャが完全にサーフェス上に存在するようにしてください。
[Z 係数] パラメータは、ラスタおよび TIN の結果にのみ影響し、テレイン データセットには影響しません。テレイン データセットから作成されたフィーチャに Z 係数を適用するには、[Z 値の調整(Adjust 3D Z)] ツールを使用します。
構文
| パラメータ | 説明 | データ タイプ |
in_surface |
The raster, TIN, or terrain surface used for interpolating z-values. | Raster Layer; Terrain Layer; TIN Layer |
in_feature_class |
The input feature class. | Feature Layer |
out_feature_class |
The output feature class. | Feature Class |
sample_distance (オプション) |
Z 値を内挿する間隔です。デフォルトでは、ラスタのセル サイズまたは TIN の自然最小ノード間隔になります。 | Double |
z_factor (オプション) |
The factor by which elevation values will be multiplied. This is typically used to convert Z linear units that match those of the XY linear units. The default is 1, which leaves elevation values unchanged. | Double |
method (オプション) |
入力フィーチャの標高値を決定するのに使用される内挿方法です。利用できるオプションは、使用されているサーフェス タイプによって異なります。BILINEAR 内挿は、ラスタ サーフェスに使用できます。この場合、入力ポイントは、最も近い 4 つのセルにある値からその標高を取得します。テレインおよび TIN データベースには、次のオプションがあります。
| String |
vertices_only (オプション) |
サンプル距離のオプションを無視して、入力フィーチャの頂点に沿ってのみ内挿を実行するかどうかを指定します。
| Boolean |
pyramid_level_resolution (オプション) |
The z-tolerance or window size resolution of the terrain pyramid level that will be used by this tool. The default is 0, or full resolution. | Double |
コードのサンプル
The following sample demonstrates the use of this tool in the Python window:
import arcpy
from arcpy import env
arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.InterpolateShape_3d("my_tin", "roads.shp", "roads_interp.shp")
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''*********************************************************************
Name: InterpolateShape Example
Description: This script demonstrates how to use InterpolateShape
on all 2D features in a target workspace.
*********************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback
# Set local variables
inWorkspace = arcpy.GetParameterAsText(0)
surface = arcpy.GetParameterAsText(1)
try:
arcpy.CheckOutExtension("3D")
# Set default workspace
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"
# Execute 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)
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)
