Select to view content in your preferred language

Raster Calculator in ArcMap Model v Pro Model

362
2
10-07-2023 09:22 AM
Labels (2)
JPGlee
by
New Contributor II

Hi there,

I have a model that I have been using in ArcMap for some time. A part of the model uses Raster Calculator to multiply a raster by a weighting (1 to 3) and stores the result in a .gdb.

The raster file is referenced via its name and pathname through a variable called 'Path Name' and the weight is supplied through a variable called 'Weight'. In the ArcMap model the simple Raster Calculator map algebra expression that worked was:

"%Path Name%" * %Weight% in ArcMap.

I have now recreated the model in Pro but the same map algebra expression keeps on giving the following error:

Error 000989 Python syntax error: File "<string>", line 1
"%Path Name%" * %Weight%
^
SyntaxError: invalid syntax

Any idea what the problem is with this?

Many thanks

Justin

0 Kudos
2 Replies
ChristopherDalu
New Contributor

Hi Justin,

I think you may need to remove the space in %Path Name%.

0 Kudos
curtvprice
MVP Esteemed Contributor

Either that or replace it with an underscore "%Path_Name%". My experiences is that spaces in variable names for rasters broke raster calculator parameter validation (checking) before substitution in the ArcMap raster calculator as well.

0 Kudos