Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Distance (Spatial Analyst)

Corridor

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Distance (Spatial Analyst)"


Related Topics

Calculates the sum of accumulative costs for two input accumulative cost rasters.

Learn more about how Corridor works


Usage tips

Command line syntax
An overview of the Command Line window
Corridor_sa <in_distance_raster1> <in_distance_raster2> <out_raster>

Parameter Explanation Data Type
<in_distance_raster1>

An input raster that was the output accumulated cost raster from a global cost function.

Composite Geodataset
<in_distance_raster2>

An input raster that was the output accumulated cost raster from a global cost function.

Composite Geodataset
<out_raster>

The raster to be created.

Raster Dataset
Data types for geoprocessing tool parameters


Command line example

Corridor_sa C:/data/raster_1 C:/data/raster_2 C:/data/final_1

Scripting syntax
About getting started with writing geoprocessing scripts
Corridor_sa (in_distance_raster1, in_distance_raster2, out_raster)

Parameter Explanation Data Type
in_distance_raster1 (Required)

An input raster that was the output accumulated cost raster from a global cost function.

Composite Geodataset
in_distance_raster2 (Required)

An input raster that was the output accumulated cost raster from a global cost function.

Composite Geodataset
out_raster (Required)

The raster to be created.

Raster Dataset

Data types for geoprocessing tool parameters


Script example

# Corridor_sample.py
# Description: 
#   Calculates the sum of accumulative costs for two input
#   accumulative cost rasters.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InRaster1 = "C:/data/raster_1"
    InRaster2 = "C:/data/raster_2"
    OutRaster = "C:/data/final_1"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: Corridor
    gp.Corridor_sa(InRaster1, InRaster2, OutRaster)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax
Corridor(<accum_grid1>, <accum_grid2>)

Parameter Explanation
<accum_grid1> An input raster that was the output accumulated cost raster from a global cost function.
<accum_grid2> An input raster that was the output accumulated cost raster from a global cost function.

Map Algebra example

corridor(ingrid1, ingrid2)
corridor(ingrid1, (ingrid2 + ingrid3))
corridor(ingrid1, costdistance(source, weight))

ArcObjects syntax
IDistanceOp::Corridor (distance1 As IGeoDataset, distance2 As IGeoDataset) As IGeoDataset

Parameter Explanation
distance1 An input Raster that was the output accumulated cost raster from the IDistance::CostDistance or other Cost method.
distance2 An input Raster that was the output accumulated cost raster from the IDistance::CostDistance or other Cost method.

ArcObjects example

' Create the RasterDistanceOp object
Dim pDistanceOp As IDistanceOp
Set pDistanceOp = New RasterDistanceOp

' Declare the input distance 1 raster object
Dim pDistance1Dataset As IGeoDataset

' Calls function to open a raster dataset from disk
Set pDistance1Dataset = OpenRasterDataset("D:\SpatialData", "dist1raster")

' Declare the input distance 2 raster object
Dim pDistance2Dataset As IGeoDataset

' Calls function to open a raster dataset from disk
Set pDistance2Dataset = OpenRasterDataset("D:\SpatialData", "dist2raster")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pDistanceOp.Corridor(pDistance1Dataset, pDistance2Dataset)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.