[GIS] Cause of ERROR 000539: Error running expression

arcgis-desktoparcmaperror-000539modelbuilderterrain

The following errors in ArcMap are preventing me from moving forward:

1) In Raster Calculator using "Aspect": "%DEM_Aspect%" <= 90 or "%DEM_Aspect%" >= 270

ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
File "", line 1, in
File "", line 5, in rcexec
ValueError: The truth value of a raster is ambiguous. Invalid use of raster with Boolean operator or function. Check the use of parentheses where applicable.

I'm using SRTM1N34W087V2, 11-FEB-00 (Void Filled) raster.

I'm attempting to use ArcMap to accomplish the same results done in the QGIS tutorial Lesson 3: Terrain Analysis.

The lesson is found here: http://manual.linfiniti.com/en/rasters/terrain_analysis.html

enter image description here

enter image description here

Best Answer

The problem with this statement is the parenthesis.. Compound statements need to be enclosed in a 'block':

Con((Condition1) | (Condition2),True_value,False_value)

enter image description here

The correct syntax for the field calculation is:

Con(("%DEM_Aspect%" <= 90) | ("%DEM_Aspect%" >= 270),1,0)
Related Question