TIN → ラスタ(TIN To Raster) (3D Analyst)
図
![]() |
使用法
-
入力 TIN サーフェスの内挿は一定の間隔で実行されるため、出力ラスタでは情報の一部分が失われる可能性があります。ラスタで TIN がどこまで正確に表現されるかは、ラスタの解像度と、TIN サーフェスの変化の程度と間隔に依存します。一般的に解像度を上げるほど、出力ラスタはより正確に TIN サーフェスを表現します。ラスタはセル構造であるため、TIN に存在するハードおよびソフト ブレークラインのエッジを維持することはできません。
-
TIN の XMIN と YMIN を原点に、また XMAX と YMAX を範囲の右上隅に使用して、TIN の全範囲を表すラスタを生成できます。または、出力ラスタの原点、範囲、および解像度またはセル間隔を指定して、TIN の一部のみを表すラスタを作成できます。
-
When exporting a large raster, consider specifying the Output Data Type as an integer to save on disk space if the accuracy requirements of your z-values are such that they can be represented by integer data.
-
出力ラスタは、ファイル ベースにするか、ジオデータベースにラスタ データセットとして作成することができます。サポートされるファイルベース形式には、Esri Grid、ERDAS IMAGINE、および TIFF があります。形式は、出力名に基づいて決定されます。ジオデータベースを参照する出力パスを指定した場合は、ジオデータベース ラスタが作成されます。出力パスが通常のファイル フォルダで、ファイル拡張子を含んでいない場合は、Esri Grid が生成されます。「.img」の拡張子を使用すると IMAGINE ファイルが生成され、「.tif」の拡張子を使用すると TIFF ファイルが生成されます。
構文
| パラメータ | 説明 | データ タイプ |
in_tin |
The input TIN. | TIN Layer |
out_raster |
The location and name of the output raster. When storing a raster dataset in a geodatabase or in a folder such as an Esri Grid, no file extension should be added to the name of the raster dataset. A file extension can be provided to define the raster's format when storing it in a folder:
If the raster is stored as a TIFF file or in a geodatabase, its raster compression type and quality can be specified using geoprocessing environment settings. | Raster Dataset |
data_type (オプション) |
The data type of the output raster can be defined by the following keywords:
| String |
method (オプション) |
ラスタの作成に使用する内挿法。
| String |
sample_distance sampling_method distance (オプション) |
The sampling method and distance used to define the cell size of the output raster.
| String |
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 |
コードのサンプル
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.TinRaster_3d("tin", "raster.img", "INT", "LINEAR", "OBSERVATIONS 250", 1)
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''******************************************************************
Name: TinRaster Example
Description: This script demonstrates how to use the
TinRaster tool to create rasters from
each TIN in the target workspace.
******************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback
try:
arcpy.CheckOutExtension("3D")
# Set environment setting
env.workspace = "C:/data"
# Set Local Variables
dataType = "INT"
method = "NATURAL_NEIGHBORS"
sampling = "CELLSIZE 10"
zfactor = "1"
# Create list of TINs
TINList = arcpy.ListDatasets("*", "Tin")
# Verify the presence of TINs in the list
if TINList:
# Iterate through the list of TINs
for dataset in TINList:
# Define the name of the output file
outRaster = "{0}_natural.img".format(dataset)
# Execute TinRaster
arcpy.ddd.TinRaster(dataset, outRaster, dataType,
method, sampling, zfactor)
print "Finished."
else:
print "There are no TIN(s) 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)
