laptop and a wrench

Error

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

ArcGIS Pro
Número de ID del error BUG-000160654
EnviadoAugust 15, 2023
Última modificaciónJune 5, 2024
Relacionado conArcGIS Pro
Versión encontrada2.9
Sistema operativoN/A
Versión de sistema operativoN/A
EstadoWill Not Be Addressed

Información adicional

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

Solución alternativa

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

Pasos para reproducir

ID del error: BUG-000160654

Software:

  • ArcGIS Pro

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga