arcpy.3d.CreateTerrain(in_feature_dataset, out_terrain_name, average_point_spacing, {max_overview_size}, {config_keyword}, {pyramid_type}, {windowsize_method}, {secondary_thinning_method}, {secondary_thinning_threshold}, {triangulation_method})
|
名前
|
説明
|
データ タイプ
|
|
in_feature_dataset
|
テレイン データセットを格納するフィーチャ データセットです。
|
Feature Dataset
|
|
out_terrain_name
|
テレイン データセットの名前です。
|
String
|
|
average_point_spacing
|
テレインのモデル化に使用するデータ ポイント間の水平方向の平均距離です。 写真測量、LiDAR、およびソナー調査など、センサーをベースとした計測値には通常、既知の間隔があり、これを使用します。 間隔には、フィーチャ データセットの座標系の水平方向の単位を使用します。
|
Double
|
|
max_overview_size
(オプション)
|
テレインのオーバービューは、画像のサムネイルの概念に似ています。 テレインのオーバービューは、テレイン データセットの最も解像度の低い表現であり、最大サイズは、オーバービューを作成するためにサンプリングされる計測ポイント数の上限です。
|
Long
|
|
config_keyword
(オプション)
|
エンタープライズ データベースのテレインのストレージを最適化するために使用されるコンフィグレーション キーワードです。
|
String
|
|
pyramid_type
(オプション)
|
テレイン ピラミッドの構築に使用するポイントの間引き方法を指定します。
WINDOWSIZE—Data points in the area defined by a given window size for each pyramid level will be selected using the windowsize_method parameter value. This is the default.
ZTOLERANCE—The vertical accuracy of each pyramid level relative to the full resolution of the data points will be specified.
|
String
|
|
windowsize_method
(オプション)
|
ウィンドウ サイズで定義される領域のポイントを選択する方法を指定します。 このパラメーターは、pyramid_type パラメーターに WINDOWSIZE を指定した場合にのみ適用されます。
ZMIN—The point with the smallest elevation value will be selected. This is the default.
ZMAX—The point with the largest elevation value will be selected.
ZMEAN—The point with the elevation value closest to the average of all values will be selected.
ZMINMAX—The points with the smallest and largest elevation values will be selected.
|
String
|
|
secondary_thinning_method
(オプション)
|
ウィンドウ サイズのピラミッドが使用されているときに平坦なエリアで使用されるポイントの数を減らすために実行される追加の間引きを指定します。 エリアのポイントの高さが secondary_thinning_threshold パラメーター値内にある場合、そのエリアは平坦であると見なされます。 その効果は、ピラミッド レベルの解像度が高いほど明白になります。より小さなエリアは、より大きなエリアよりも平坦である可能性が高いためです。
NONE—No secondary thinning will be performed. This is the default.
MILD—Mild thinning will be performed to preserve linear discontinuities (for example, building sides and forest boundaries). This method is recommended for lidar that includes both ground and nonground points. It will thin the fewest points.
MODERATE—Moderate thinning will be performed, which provides a balance between performance and accuracy. This method does not preserve as much detail as mild thinning but comes close while eliminating more points overall.
STRONG—Strong thinning will be performed, which removes the most points but is less likely to preserve sharply delineated features. Limit its use to surfaces where slope tends to change gradually. For example, strong thinning is efficient for bare-earth lidar and bathymetry.
|
String
|
|
secondary_thinning_threshold
(オプション)
|
pyramid_type パラメーターが WINDOWSIZE に設定されている場合に、フィルターの二次間引きを有効にするときに使用する鉛直方向の閾値です。 データの鉛直精度以上の値を設定します。
|
Double
|
|
triangulation_method
(オプション)
|
TIN サーフェスを構築するためのドロネー三角形分割の規則に準拠するためにセグメントを密集化することによって、ブレークライン フィーチャがテレイン サーフェスに組み込まれるかどうかを指定します。
ドロネー三角形分割法は、ブレークライン フィーチャを密集化して、TIN ベースのサーフェスを解析するときに通常不適切な結果を生成する細長い三角形の作成を回避する方法で、ブレークライン フィーチャ周囲のポイントに対処します。 また、Natural Neighbor 内挿法とティーセン (ボロノイ) ポリゴンの生成は、ドロネー三角形分割法への適合に対してのみ実行できます。
制限付きドロネー三角形分割法はブレークライン フィーチャを密集化せず、ブレークライン セグメントをエッジとして TIN サーフェスに組み込みます。 三角形分割によって変更されない (つまり、複数のエッジに分割されない) ことが保証されるエッジを明示的に定義する必要があるときには、このオプションを検討します。
|
String
|
派生した出力
|
名前
|
説明
|
データ タイプ
|
|
derived_out_terrain
|
新しいテレイン データセット。
|
Terrain
|
コードのサンプル
CreateTerrain の例 1 (Python ウィンドウ)
次のサンプルは、Python ウィンドウでこのツールを使用する方法を示しています:
arcpy.env.workspace = 'C:/data'
arcpy.ddd.CreateTerrain('source.gdb/Redlands', 'Redlands_terrain', 5,
50000, '', 'WINDOWSIZE', 'ZMIN', 'NONE', 1)
CreateTerrain の例 2 (スタンドアロン スクリプト)
次のサンプルは、スタンドアロン Python スクリプトでこのツールを使用する方法を示しています:
"""****************************************************************************
Name: Create Terrain from TIN
Description: This script demonstrates how to create a terrain dataset using
features extracted from a TIN. It is particularly useful in
situations where the source data used in the TIN is not available,
and the amount of data stored in the TIN proves to be too large
for the TIN. The terrain's scalability will allow improved
display performance and faster analysis. The script is designed
to work as a script tool with 5 input arguments.
****************************************************************************"""
# Import system modules
import arcpy
# Set local variables
tin = arcpy.GetParameterAsText(0) # TIN used to create terrain
gdbLocation = arcpy.GetParameterAsText(1) # Folder that will store terran GDB
gdbName = arcpy.GetParameterAsText(2) # Name of terrain GDB
fdName = arcpy.GetParameterAsText(3) # Name of feature dataset
terrainName = arcpy.GetParameterAsText(4) # Name of terrain
try:
# Create the file gdb that will store the feature dataset
arcpy.management.CreateFileGDB(gdbLocation, gdbName)
gdb = '{0}/{1}'.format(gdbLocation, gdbName)
# Obtain spatial reference from TIN
SR = arcpy.Describe(tin).spatialReference
# Create the feature dataset that will store the terrain
arcpy.management.CreateFeatureDataset(gdb, fdName, SR)
fd = '{0}/{1}'.format(gdb, fdName)
# Export TIN elements to feature classes for terrain
arcpy.AddMessage("Exporting TIN footprint to define terrain boundary...")
boundary = "{0}/boundary".format(fd)
# Run TinDomain
arcpy.ddd.TinDomain(tin, tinDomain, 'POLYGON')
arcpy.AddMessage("Exporting TIN breaklines...")
breaklines = "{0}/breaklines".format(fd)
# Run TinLine
arcpy.ddd.TinLine(tin, breaklines, "Code")
arcpy.AddMessage("Exporting TIN nodes...")
masspoints = "{0}/masspoints".format(fd)
# Run TinNode
arcpy.ddd.TinNode(sourceTIN, TIN_nodes)
arcpy.AddMessage("Creating terrain dataset...")
terrain = "terrain_from_tin"
# Run CreateTerrain
arcpy.ddd.CreateTerrain(fd, terrainName, 10, 50000, "",
"WINDOWSIZE", "ZMEAN", "NONE", 1)
arcpy.AddMessage("Adding terrain pyramid levels...")
terrain = "{0}/{1}".format(fd, terrainName)
pyramids = ["20 5000", "25 10000", "35 25000", "50 50000"]
# Run AddTerrainPyramidLevel
arcpy.ddd.AddTerrainPyramidLevel(terrain, "", pyramids)
arcpy.AddMessage("Adding features to terrain...")
inFeatures = "{0} Shape softclip 1 0 10 true false boundary_embed <None> "\
"false; {1} Shape masspoints 1 0 50 true false points_embed "\
"<None> false; {2} Shape softline 1 0 25 false false lines_embed "\
"<None> false".format(boundary, masspoints, breaklines)
# Run AddFeatureClassToTerrain
arcpy.ddd.AddFeatureClassToTerrain(terrain, inFeatures)
arcpy.AddMessage("Building terrain...")
# Run BuildTerrain
arcpy.ddd.BuildTerrain(terrain, "NO_UPDATE_EXTENT")
arcpy.GetMessages()
except arcpy.ExecuteError:
print(arcpy.GetMessages())
except Exception as err:
print(err)