Topo to Raster by File (Spatial Analyst)

Summary

Interpolates a hydrologically correct raster surface from point, line, and polygon data using parameters specified in a file.

Learn more about how Topo to Raster works

Usage

Syntax

TopoToRasterByFile (in_parameter_file, {out_stream_features}, {out_sink_features})
ParameterExplanationData Type
in_parameter_file

The input ASCII text file containing the inputs and parameters to use for the interpolation.

The file is typically created from a previous run of Topo to Raster with the optional output parameter file specified.

In order to test the outcome of changing the parameters, it is easier to make edits to this file and rerun the interpolation than to correctly issue the Topo to Raster tool each time.

File
out_stream_features
(Optional)

Output feature class of stream polyline features.

Feature Class
out_sink_features
(Optional)

Output feature class of remaining sink point features.

Feature Class

Return Value

NameExplanationData Type
out_surface_raster

The output interpolated surface raster.

Raster

Code Sample

TopoToRasterByFile example 1 (Python window)

This example creates a hydrologically correct TIFF surface raster from a parameter file defining the input point, line, and polygon data.

import arcpy
from arcpy import env  
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outTTRByFile = TopoToRasterByFile("topotorasterbyfile.txt", 
                   "C:/sapyexamples/output/out_streams.shp")
outTTRByFile.save("C:/sapyexamples/output/ttrbyfout.tif")
TopoToRasterByFile example 2 (stand-alone script)

This example creates a hydrologically correct GRID surface raster from a parameter file defining the input point, line, and polygon data.

# Name: TopoToRasterByFile_Ex_02.py
# Description: Interpolates a hydrologically correct 
#    surface from point, line, and polygon data using
#    parameters specified in a file.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inParameterFile = "topotorasterbyfile.txt"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute TopoToRasterByFile
outTTRByFile = TopoToRasterByFile(inParameterFile)

# Save the output 
outTTRByFile.save("C:/sapyexamples/output/ttrbyfout02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst or 3D Analyst
ArcEditor: Requires Spatial Analyst or 3D Analyst
ArcInfo: Requires Spatial Analyst or 3D Analyst

6/29/2011