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 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项