# 廊道分析 (空间分析)

## 用法

• 尽管任何两个栅格都可用于输入，但是要获得有意义的结果，栅格应为未更改的累积成本输出栅格。

• 这两个输入的顺序不相关。

## 语法

Corridor (in_distance_raster1, in_distance_raster2)
 参数 说明 数据类型 in_distance_raster1 第一个输入距离栅格。它应是来自距离工具的累积成本距离输出，如成本距离或路径距离。 Raster Layer in_distance_raster2 第二个输入距离栅格。它应是来自距离工具的累积成本距离输出，如成本距离或路径距离。 Raster Layer

#### 返回值

 名称 说明 数据类型 out_raster 输出廊道栅格。 Raster

## 代码实例

“廊道”示例 1（Python 窗口）

``````import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outCorr = Corridor("costraster", "focalcost.tif")
outCorr.save("c:/sapyexamples/output/corridor")
``````
“廊道”示例 2（独立脚本）

``````# Name: Corridor_Ex_02.py
# Description: Calculate a potential wildlife corridor between
#              two known protected areas.
# Requirements: Spatial Analyst Extension

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

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

# Set local variables
inCostRaster = "costdist01"
nextCostRaster = "cotdist02"

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

# Execute Corridor
outCorridor = Corridor(inCostRaster, nextCostRaster)

#Limit the corridor to a threshold to show a potential corridor
corridor = Con(outCorridor, 1, 0, "VALUE < 100")

# Save the output
outCorridor.save("C:/sapyexamples/output/costout")
``````

## 许可信息

ArcGIS for Desktop Basic: 需要 Spatial Analyst
ArcGIS for Desktop Standard: 需要 Spatial Analyst
ArcGIS for Desktop Advanced: 需要 Spatial Analyst
5/10/2014