Spatial Analyst のライセンスで利用可能。

Image Analyst ライセンスで利用できます。

## 概要

Adds (sums) the values of two rasters on a cell-by-cell basis.

## ディスカッション

ラスター入力で演算子を使用すると、結果はラスターになります。ただし、すべての入力値が数字の場合、結果は数字になります。

この演算子では、入力の順序は結果に影響しません。

Another way to perform the addition operation is a += b, which is an alternative way to write a = a + b.

## 構文

`in_raster_or_constant1 + in_raster_or_constant2`
 オペランド 説明 データ タイプ in_raster_or_constant1 The input to which values will be added. If one of the input is a raster and the other is a scalar, an output raster is created with the scalar value being added to each cell in the input raster. Raster Layer | Constant in_raster_or_constant2 The input whose values will be added to the first input. If one of the inputs is a raster and the other is a scalar, an output raster is created with the scalar value being added to each cell in the input raster. Raster Layer | Constant

#### 戻り値

 名前 説明 データ タイプ out_raster 出力ラスター オブジェクト。The cell values are the sum of the first input added to the second. Raster

## コードのサンプル

+ (Addition) example 1 (Python window)

This sample adds two input rasters.

``````import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outPlus = Raster("degs") + Raster("negs")
outPlus.save("C:/sapyexamples/output/outplus.img")``````
+ (Addition) example 2 (stand-alone script)

This sample adds two input rasters.

``````# Name: Op_Plus_Ex_02.py
# Description: Adds the values of two rasters on a cell-by-cell basis.
# 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
inRaster1 = Raster("cost")
inRaster2 = Raster("degs")

# Execute Plus
outPlus = inRaster1 + inRaster2

# Save the output
outPlus.save("C:/sapyexamples/output/outplus")``````