laptop and a wrench

不具合

Unable to apply the Mask environment setting when running the Raster Calculator tool using ArcPy.

ArcGIS Pro
不具合 ID 番号 BUG-000160654
送信されましたAugust 15, 2023
最終更新日June 5, 2024
適用対象ArcGIS Pro
見つかったバージョン2.9
オペレーティング システムN/A
オペレーティング システムのバージョンN/A
ステータスWill Not Be Addressed

参考情報

The Raster Calculator tool is not intended for use in Python. The Raster Calculator tool is used to perform Map Algebra using Python in the User Interface, ie ModelBuilder. Map Algebra in Python can be performed natively. Map Algebra does not need to be wrapped inside a geoprocessing tool like the Raster Calculator tool. Perform Map Algebra like this: from arcpy.sa import * arcpy.env.mask ="C:\\temp\\BUG-000160654\\repro\\ManalData\\blkgrp.shp" ras1 = arcpy.Raster('usgsdem') ras2 = arcpy.Raster('gfchot') myras = ras1*ras2

対処法

The Raster Calculator tool is not intended for use in Python. The Raster Calculator tool is used to perform Map Algebra using Python in the User Interface, ie ModelBuilder. Map Algebra in Python can be performed natively. Map Algebra does not need to be wrapped inside a geoprocessing tool like the Raster Calculator tool.

Perform Map Algebra like this:

from arcpy.sa import *

arcpy.env.mask ="C:\\temp\\BUG-000160654\\repro\\ManalData\\blkgrp.shp"

ras1 = arcpy.Raster('usgsdem')

ras2 = arcpy.Raster('gfchot')

myras = ras1*ras2

再現の手順

不具合 ID: BUG-000160654

ソフトウェア:

  • ArcGIS Pro

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動