+ (Unary Plus) operator

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

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

サマリー

Multiplies each cell value of the input raster on a cell-by-cell basis by 1.

Negate illustration
OutRas = + Raster("InRas1")

説明

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

複数の演算子が式に使用されている場合、それらは必ずしも左から右への順に実行されるわけではありません。 優先順位値が最も高い演算子が最初に実行されます。 詳細については、「マップ代数演算の演算子の操作」の演算子の優先順位のテーブルをご参照ください。 実行順序の制御には、括弧が使用できます。

If the input is integer, the output will contain integer values; if the input is floating point, the output will contain floating-point values.

入力がマルチバンド ラスターの場合、出力もマルチバンド ラスターになります。 演算子は、入力の各バンドに演算を実行します。

入力が多次元ラスターである場合、すべての変数に含まれるすべてのスライスが処理され、出力は多次元ラスターになります。

パラメーター

オペランド説明データ タイプ
in_raster_or_constant

The input raster to apply the Unary Plus operator (multiply by 1).

Raster Layer | Constant

コードのサンプル

Unary + (Unary Plus) example 1 (Python window)

This sample applies the Unary Plus operator to the input raster.

import arcpy
from arcpy import env
from arcpy.ia import *
env.workspace = "C:/iapyexamples/data"
outUnaryPlus = + Raster("degs")
outUnaryPlus.save("C:/iapyexamples/output/outdeg")
Unary + (Unary Plus) example 2 (stand-alone script)

This sample applies the Unary Plus operator to the input raster.

# Name: Op_UnaryPlus_Ex_02.py
# Description: Returns the cell valuesof the input raster on a cell-by-cell 
#    basis. 
# Requirements: Image Analyst Extension

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

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

# Set local variables
inRaster = Raster("degs")

# Execute Negate
outUnaryPlus = +(inRaster)

# Save the output 
outUnaryPlus.save("C:/iapyexamples/output/outunplus")

関連トピック