Select to view content in your preferred language

raster calc issue in model builder

1305
2
02-27-2017 07:02 AM
by Anonymous User
Not applicable

I have a model that I could run on previous versions of ArcMap but not on 10.4.1. The last step in the model is a raster calculator expression that changes all null values to 0. The equation is "Con( IsNull( "%raster1%"), 0, "%raster1%" + Con( IsNull( "raster2%"), 0, "%raster2%")" 

This equation works when running raster calc by itself but not when part of a model. I get error 000989, Python syntax error: Parsing error SyntaxError: unexpected EOF while Parsing (line1). 

Has anyone had a similar issue or have a work around? 

0 Kudos
2 Replies
curtvprice
MVP Alum

What are the values in %raster1% and %raster2%?  What's the full dialog from the command window?

I ask because 1) you say it works when run as a tool and 2) the way Raster Calculator works in ModelBuilder is it first substitutes the values of variables into the string, does any raster path conversion (ie wrapping raster paths with Raster()) and then passes the resuling arcpy map algebra execute string to Python. 

by Anonymous User
Not applicable

Hi Curtis,

The values are travel sheds. I got it to work. I exported it to python was able fix it from there with help from some of the developers I work with. 

Thanks for your help