合并 (空间分析)

许可等级:BasicStandardAdvanced

摘要

合并多个栅格,从而为输入值的各种唯一组合生成唯一输出值。

插图

Combine illustration
OutRas = Combine([InRas1, InRas2])

用法

语法

Combine (in_rasters)
参数说明数据类型
in_rasters
[in_raster,...]

要合并的输入栅格列表。

Raster Layer

返回值

名称说明数据类型
out_raster

输出组合栅格。为输入值的各种唯一组合生成唯一整数值。

Raster

代码实例

合并 (Combine) 示例 1(Python 窗口)

本例将接收多个不同格式(Grid、IMG 和 TIFF)的输入栅格并将唯一组合值输出为 Grid 栅格。

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outCombine = Combine(["filter", "zone", "source.img", "dec.tif"])
outCombine.save("C:/sapyexamples/output/outcombine2")
合并 (Combine) 示例 2(独立脚本)

本例将接收多个不同格式(Grid、IMG 和 TIFF)的输入栅格并将唯一组合值输出为 Grid 栅格。

# Name: Combine_Ex_02.py
# Description: Combines multiple rasters such that a unique value is
#              assigned to each unique combination of input values
# 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
inRaster01 = "filter"
inRaster02 = "zone"
inRaster03 = "source.img"
inRaster04 = "dec.tif"

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

# Execute Combine
outCombine = Combine([inRaster01,inRaster02,inRaster03,inRaster04])

# Save the output 
outCombine.save("C:/sapyexamples/output/outcombine")

环境

相关主题

许可信息

ArcGIS for Desktop Basic:需要 Spatial Analyst
ArcGIS for Desktop Standard:需要 Spatial Analyst
ArcGIS for Desktop Advanced:需要 Spatial Analyst
9/15/2013