The equation includes several raster and several single values, and I want to do it in raster calculator, modelbuilder for the purpose of multiple calculations. In raster part, it is ok to select raster band, but how about the single values? I have selected any value under the function of create variable, but it does not work.

The expression is Cos("%Solar Zenith Angle%") * Cos("%Slope%") + Sin("%Solar Zenith Angle%") * Sin("%Slope%") * Cos("%Solar Azimuth Angle%" - "%Aspect%")

P.S. Slope and aspect are both raster, and Solar Zenith Angle and Solar Azimuth Angle are only single values.

It works, when I use raster calculator directly, so I think the problem probably comes from the variable type.

Any hint? Thanks!

  • Could you share your expression with us? – Barbarossa Jan 22 '14 at 17:14
  • When you create the variables, you select "a single value" and "Raster Layer"? – Barbarossa Jan 22 '14 at 17:50
  • @Barbarossa I selected "raster band" and "any value". – Vicky Liau Jan 22 '14 at 17:53

Try putting your variable inside of float() i.e. float(%Variable%). This will be necessary for data types Double or Any Value.

float(%Any Value%) or float(%Double%)

You can also create a variable of type Long, if a decimal place is not necessary.

| 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.