ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Combine

Available with Spatial Analyst license.

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Combines multiple rasters so that a unique output value is assigned to each unique combination of input values.

Illustration

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

Usage

  • The Combine tool works on integer values and their associated attribute tables. If the values on the input are floating point, they will be automatically truncated, tested for uniqueness with the other input, and sent to the output attribute table.

  • The Combine tool is similar to the Combinatorial Or tool. They both assign a new number to each unique combination of input values.

  • No more than 20 rasters can be used as input to Combine.

  • If a cell location contains NoData on any of the input rasters, that location will be assigned NoData on the output.

  • The output raster is always of integer type.

  • For formats other than Esri Grid, by default, the output raster from this tool can only have a maximum of 65,536 unique values.

    You can increase this number by changing a setting in ArcGIS. On the main menu, select Customize > ArcMap Options. In the ArcMap Options dialog box, click the Raster tab and modify the Maximum number of unique values to display field to an appropriate value.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

Combine (in_rasters)
ParameterExplanationData Type
in_rasters
[in_raster,...]

The list of input rasters to be combined.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output combined raster.

A unique integer value is assigned to each unique combination of input values.

Raster

Code Sample

Combine example 1 (Python window)

This example takes several input rasters in different formats (Grid, IMG, and TIFF) and outputs the unique combination values as a Grid raster.

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 example 2 (stand-alone script)

This example takes several input rasters in different formats (Grid, IMG, and TIFF) and outputs the unique combination values as a Grid raster.

# 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")

Environments

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Local toolset
  • Combining multiple rasters
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal