>= (Relational Greater Than Equal To) operator

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

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

サマリー

Returns 1 for cells where the first raster is greater than or equal to the second raster and 0 if it is not.

Greater Than Equal To (Relational) operator illustration
OutRas = Raster("InRas1") >= 2

説明

The relational greater-than-or-equal-to operation evaluates the first input value in relation to the second input value on a cell-by-cell basis within the Analysis window. In the relational evaluation, if the condition is true (the first input value is greater than or equal to the second input value), the output is 1; if it is false, the output is 0.

    Input1 > Input2, Output = 1
    Input1 = Input2, Output = 0
    Input1 < Input2, Output = 0

When one or both input values are NoData, the output is NoData.

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

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

ブール (~&^|) 演算子には、関係 (<<=>>===!=) 演算子よりも高い優先度があります。 したがって、ブール演算子が関係演算子と同じ式に使用されている場合、ブール演算子が最初に実行されます。 実行の順序を変更するには、括弧を使用します。

複数の関係および (または) ブール演算子が 1 つの式で連続して使用されているときは、場合によっては実行されない可能性があります。 このような問題を避けるために、式に適切な括弧を使用して、演算の実行順序を明示的に定義します。 詳細については、「複雑なステートメントの構築」の複雑なステートメントのルールに関するセクションをご参照ください。

評価を実行するには、2 つの入力値が必要です。

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

出力値は、必ず整数になります。

両方の入力がシングルバンド ラスターである場合、またはいずれかの入力が定数である場合、出力はシングルバンド ラスターになります。

両方の入力がマルチバンド ラスターである場合、演算子は 1 つの入力に含まれるバンドごとに演算を実行し、出力はマルチバンド ラスターになります。 各マルチバンド入力のバンド数は同一である必要があります。

入力のうちの 1 つがマルチバンド ラスターであり、もう 1 つが定数である場合、演算子はマルチバンド入力に含まれるバンドごとに定数値に対して演算を実行し、出力はマルチバンド ラスターになります。

両方の入力が多次元ラスターであり、変数の数が同じである場合、演算子は同じディメンション値を持つすべてのスライスに対して演算を実行し、出力は多次元ラスターになります。 入力に含まれる変数には同じディメンションまたは共通のディメンションが必要です。共通でないディメンションが存在してはなりません。

両方の入力に 1 つの変数が含まれているが、名前が異なっている場合は、演算を実行するために、matchMultidimensionalVariable ジオプロセシング環境を False に設定します。

入力のうちの 1 つが多次元ラスターであり、もう 1 つが定数である場合、演算子は定数値に対してすべての変数に含まれるすべてのスライスの演算を実行し、出力は多次元ラスターになります。

パラメーター

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

The input being tested to determine if it is greater than or equal to the second input.

入力値の 1 つがラスターで、もう 1 つがスカラーである場合は、入力ラスターの各セルに実行される評価を持った出力ラスターが作成されます。

Raster Layer | Constant
in_raster_or_constant2

The input against which the first input is tested to be greater than or equal to.

入力値の 1 つがラスターで、もう 1 つがスカラーである場合は、入力ラスターの各セルに実行される評価を持った出力ラスターが作成されます。

Raster Layer | Constant

コードのサンプル

>= (Greater Than Equal To) example 1 (Python window)

This sample performs a Greater Than Equal To operation on two input rasters.

import arcpy
from arcpy import env
from arcpy.ia import *
env.workspace = "C:/iapyexamples/data"
outGTE = Raster("degs") >= Raster("negs")
outGTE.save("C:/iapyexamples/output/outgte.tif")
>= (Greater Than Equal To) example 2 (stand-alone script)

This sample performs a Greater Than Equal To operation on two input rasters.

# Name: Op_GreaterThanEqual_Ex_02.py
# Description: Performs a relational greater-than-equal operation on
#              two inputs on a cell-by-cell basis within the Analysis
#              window
# 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
inRaster1 = Raster("degs")
inRaster2 = Raster("negs")

# Execute GreaterThanEqual
outGTE = inRaster1 >= inRaster2

# Save the output 
outGTE.save("C:/iapyexamples/output/outgte")

関連トピック