テレイン → ラスタ(Terrain To Raster) (3D Analyst)

サマリ

テレイン データセットをラスタに変換します。

使用法

構文

TerrainToRaster_3d (in_terrain, out_raster, {data_type}, {method}, {sample_distance}, {pyramid_level_resolution})
パラメータ説明データ タイプ
in_terrain

The input terrain dataset.

Terrain 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:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .img—ERDAS IMAGINE
  • .png—PNG
  • .tif—TIFF

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:

  • FLOATOutput raster will use 32-bit floating point, which supports values ranging from -3.402823466e+38 to 3.402823466e+38. This is the default.
  • INTOutput raster will use an appropriate integer bit depth. This option will round Z-values to the nearest whole number and write an integer to each raster cell value.
String
method
(オプション)

内挿法を選択します。デフォルトでは、セル値はリニア内挿法を使用して計算されます。

  • LINEARセル値を、TIN 三角形のリニア内挿法を使用して計算します。
  • NATURAL_NEIGHBORSセル値を、TIN 三角形の Natural Neighbor 内挿法を使用して計算します。
String
sample_distance
sampling_method distance
(オプション)

The sampling method and distance used to define the cell size of the output raster.

  • OBSERVATIONS—Defines the number of cells on the longest side of the output raster. This method is used by default with a distance of 250.
  • CELLSIZE—Defines the cell size of the output raster.
String
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

コードのサンプル

TerrainToRaster(テレイン → ラスタ)の例 1(Python ウィンドウ)

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.TerrainToRaster_3d("sample.gdb/featuredataset/terrain", "terrain.img", "INT", "LINEAR", "CELLSIZE 10", 2.5)
TerrainToRaster(テレイン → ラスタ)の例 2(スタンドアロン スクリプト)

The following sample demonstrates the use of this tool in a stand-alone Python script:

'''*********************************************************************
Name: TerrainToRaster Example
Description: This script demonstrates how to use the 
             TerrainToRaster tool.
             
**********************************************************************'''
# 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
    terrain = "sample.gdb/featuredataset/terrain"
    bitType = "INT"
    method = "LINEAR"
    sampling = "CELLSIZE 10"
    pyrLvl = 2.5
    outRas = arcpy.CreateUniqueName("terrain_level.img")    
    #Execute TerrainToRaster
    arcpy.ddd.TerrainToRaster(terrain, outRas, bitType, 
                              method, sampling, pyrLvl)
    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)

環境

関連項目

ライセンス情報

ArcView: 必須 3D Analyst
ArcEditor: 必須 3D Analyst
ArcInfo: 必須 3D Analyst

7/10/2012