Label | Explanation | Data Type |
Input Terrain | The terrain dataset that will be processed. | Terrain Layer |
Output 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, do not add a file extension 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, such as .tif to generate a GeoTIFF or .img to generate an ERDAS IMAGINE format file. If the raster is stored as a .tif file or in a geodatabase, the raster compression type and quality can be specified using geoprocessing environment settings. | Raster Dataset |
Output Data Type
(Optional) | Specifies the type of numeric values that will be stored in the output raster.
| String |
Method (Optional) | The interpolation method that will be used to calculate cell values.
| String |
Sampling Distance (Optional) | The sampling method and distance used to define the cell size of the output raster. | String |
Pyramid Level Resolution (Optional) | The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default is 0, or full resolution. | Double |
Summary
Interpolates a raster using z-values from a terrain dataset.
Usage
To extract a subset of the terrain, define the extent using the geoprocessing environment settings.
Parameters
arcpy.ddd.TerrainToRaster(in_terrain, out_raster, {data_type}, {method}, {sample_distance}, {pyramid_level_resolution})
Name | Explanation | Data Type |
in_terrain | The terrain dataset that will be processed. | 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, do not add a file extension 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, such as .tif to generate a GeoTIFF or .img to generate an ERDAS IMAGINE format file. If the raster is stored as a .tif file or in a geodatabase, the raster compression type and quality can be specified using geoprocessing environment settings. | Raster Dataset |
data_type (Optional) | Specifies the type of numeric values that will be stored in the output raster.
| String |
method (Optional) | The interpolation method that will be used to calculate cell values.
| String |
sample_distance sampling_method distance (Optional) | The sampling method and distance used to define the cell size of the output raster. | String |
pyramid_level_resolution (Optional) | The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default is 0, or full resolution. | Double |
Code sample
The following sample demonstrates the use of this tool in the Python window.
arcpy.env.workspace = "C:/data"
arcpy.ddd.TerrainToRaster("sample.gdb/featuredataset/terrain", "terrain.tif",
data_type="FLOAT", method="LINEAR",
sample_distance="CELLSIZE 10", pyramid_level_resolution=2.5)
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
# Set environment setting
arcpy.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)