ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

&

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

  • 概要
  • 図
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

概要

Performs a Boolean And operation on the cell values of two input rasters.

図

Boolean And illustration
OutRas = Raster("InRas1") & Raster("InRas2")

ディスカッション

The & operator will perform a Boolean And operation when one or more input (operand) is a raster. If both inputs (operands) are numbers, then the & operator will perform Bitwise And operation. For more information on how to work with operators, see Working with operators.

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

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

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

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

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

入力値が浮動小数点数値の場合は、ブール演算を実行する前に値を切り捨てて整数値に変換されます。出力値は、必ず整数になります。

Another way to perform the Boolean And 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 first input to use in the Boolean And operation.

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

Raster Layer | Constant
in_raster_or_constant2

The second input to use in the Boolean And operation.

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

Raster Layer | Constant

戻り値

名前説明データ タイプ
out_raster

出力ラスター オブジェクト。

出力値は 0 または 1 です。

Raster

コードのサンプル

& (Boolean And) example 1 (Python window)

This sample performs a Boolean And operation on two input rasters.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outBooleanAnd = Raster("degs") & Raster("negs")
outBooleanAnd.save("C:/sapyexamples/output/outbooland.img")
& (Boolean And) example 2 (stand-alone script)

This sample performs a Boolean And operation on two input rasters.

# Name: Op_BooleanAnd_Ex_02.py
# Description: Performs a Boolean And operation on the cell values
#              of two input rasters
# 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("degs")
inRaster2 = Raster("negs")

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

# Execute BooleanAnd
outBooleanAnd = inRaster1 & inRaster2

# Save the output 
outBooleanAnd.save("C:/sapyexamples/output/outbooland")

環境

  • セル サイズ
  • 現在のワークスペース
  • マスク
  • 出力座標系
  • 範囲
  • テンポラリ ワークスペース
  • スナップ対象ラスター

関連トピック

  • An overview of the Map Algebra Operators

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル