I am trying to create a binary raster using the Raster Calculator in ArcGIS 10.2. I have a raster with ~20 different values, but I'm only interested in cells where the value = 10. I've been using the conditional argument, but I think there might be a problem with my variables having text associated with them; I keep getting "Error 000539: Runtime error Syntax Error: Keyword can't be an expression."

I've used the following:
Con("InputRaster" = 10, 1, 0)

This didn't specify where the variable values were, so I tried:
Con("InputRaster", "Value" = 10, 1, 0)

And then I tried enclosing the argument:
Con("InputRaster", '"Value" = 10', 1, 0)

In all instances, I received the exact same error message. In the "value" column in my attribute table, only numbers are listed, not text, so there shouldn't be an issue with non-numeric values. The associated text only appears in the table of contents, next to the numeric value.

Any thoughts on how to fix my equation?


1 Answer 1


I think you might need to use a double = sign, as this finally worked for me:

Con("%InputRaster%" == 1, 99, 0)

Make sure also the InputRaster is the actual name of the output and not the name of the model element... raster calculator seems to want the name of the dataset on disk.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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