0.1". >>> Con(("Random1.tif" > 0.1),"Random1.tif",Con(("Random2.tif">0.1),"Random2.tif",0.1)) In stead, defining a raster object first for this layer, then the complex expression should work. >>> rasob = arcpy.sa.Raster("Random1.tif") >>> outras = Con((rasob > 0.1),"Random1.tif",Con((rasob> 0.1),"Random2.tif",0.1))"/>
laptop and a wrench

Error

The prescribed Python syntax for complex conditional expressions does not work outside of the Raster Calculator.

Última publicación: February 17, 2017 ArcGIS for Desktop
Número de ID del error BUG-000087994
EnviadoJune 1, 2015
Última modificaciónJune 5, 2024
Relacionado conArcGIS for Desktop
Versión encontrada10.0
Sistema operativoWindows OS
Versión de sistema operativo7 64 Bit
EstadoKnown Limit

Información adicional

The expression below won''t work in python, because map algebra take raster object as input, while "Random1.tif" would be treated as string but not raster in the expression ""Random1.tif">0.1". >>> Con(("Random1.tif" > 0.1),"Random1.tif",Con(("Random2.tif">0.1),"Random2.tif",0.1)) In stead, defining a raster object first for this layer, then the complex expression should work. >>> rasob = arcpy.sa.Raster("Random1.tif") >>> outras = Con((rasob > 0.1),"Random1.tif",Con((rasob> 0.1),"Random2.tif",0.1))

Solución alternativa

Using the syntax containing the <where_clause> parameter from the following help resources, it is still possible to create complex Conditional expressions. 10.0: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000008000000.htm. 10.2: http://resources.arcgis.com/en/help/main/10.2/index.html#//009z00000008000000. 10.3: http://desktop.arcgis.com/en/desktop/latest/tools/spatial-analyst-toolbox/conditional-evaluation-with-con.htm.

Pasos para reproducir

ID del error: BUG-000087994

Software:

  • ArcGIS for Desktop

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