1

I am new to Arc and 10.2 but can not seem to figure out why this won't work.

Executing: RasterCalculator Con(("SLOPE_SLO.tif"  >=  .015) & ("SLOPE_SLO.tif" <= .15,1,0)) D:\GEOG_480\Final2\RastCalSlope
Start Time: Tue Jul 29 22:24:21 2014
Con((Raster(r"SLOPE_SLO.tif")  >=  .015) & (Raster(r"SLOPE_SLO.tif") <= .15,1,0))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 5, in rcexec
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 3620, in BooleanAnd
    in_raster_or_constant2)
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Utils.py", line 47, in swapper
    result = wrapper(*args, **kwargs)
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 3617, in Wrapper
    ["BooleanAnd", in_raster_or_constant1, in_raster_or_constant2])
TypeError: expected a raster or layer name

Failed to execute (RasterCalculator).
Failed at Tue Jul 29 22:24:21 2014 (Elapsed Time: 0.02 seconds)
  • 1
    It looks like it's having difficulty finding your files. Are you doing this in ArcMap or ArcCatlog or python? Your syntax isn't correct.. Con(("SLOPE_SLO.tif" >= .015) & ("SLOPE_SLO.tif" <= .15),1,0) would be better. – Michael Stimson Jul 30 '14 at 3:40
  • Make sure your raster have defined spatial references. Because of this I was struggeling with the same Error eigther with raster calculator or math. – EikeMike Nov 21 '19 at 8:05
1

As indicated by @MichaelMiles-Stimson in his comment:

Your syntax isn't correct..

Con(("SLOPE_SLO.tif" >= .015) & ("SLOPE_SLO.tif" <= .15),1,0)

would be better.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.