Select to view content in your preferred language

simple map algebra

2661
4
02-19-2012 06:40 PM
JeffClark2
Emerging Contributor
I'm having trouble getting the raster calculator to work in ArcMap 10.3 with spatial anlayst extension. I'm using the raster calculator to do something simple like add or subtract 100 from each cell in the raster. I use the following expression Float ("raster") - 100.0 The tool runs fine, but the results are strange. A DN in the original raster of 47 returns a value of -36. A DN of 26 returns a -48. I've also tried dividing two rasters (using Float), when I do that I get all 1's.

Please advise.
0 Kudos
4 Replies
curtvprice
MVP Esteemed Contributor
ArcMap 10.3 with spatial anlayst extension.


Just to clarify, do you mean 10.0 SP 3?
0 Kudos
JeffClark2
Emerging Contributor
Yes, I'm Sorry ArcGIS 10.0 (Info Level) with SP3. Had same problem with SP2. Some additional points 1. the NDVI function off the Image Analysis window works fine. And if I convert the raster to a float through the tool box and then perform simple math using the toolboxes (not the Raster Calculator) it works fine. Seems like there is something wrong with the raster calculator.
0 Kudos
curtvprice
MVP Esteemed Contributor
Looks like something you should report! If you get a NIM, please add it to this thread.

I am wondering whether the issue may be data format related... is "raster" not a grid? The calculator may be doing a bad data translation on the direct read of the raster (a new capability in 10.0, in 9.3 it would convert to Esri Grid format (EGF) first).  Kind of weird that the tools would work when map algebra doesn't -- the tools are the same now under the hood.

Something to try is convert your raster to EGF (using Copy Raster) and try Raster Calculator with that.
0 Kudos
PrasantaBhattarai
Esri Contributor
I'm having trouble getting the raster calculator to work in ArcMap 10.3 with spatial anlayst extension. I'm using the raster calculator to do something simple like add or subtract 100 from each cell in the raster. I use the following expression Float ("raster") - 100.0 The tool runs fine, but the results are strange. A DN in the original raster of 47 returns a value of -36. A DN of 26 returns a -48. I've also tried dividing two rasters (using Float), when I do that I get all 1's.

Please advise.


Hi Jeff,
I ran a quick test with raster calculator (see attached screen-captures) to subtract and divide, and it seems to be working fine for me. Input data I was using is an integer raster (.TIF) and the output is a floating point raster (.TIF). If you can consistently reproduce this issue with different data, I would suggest you to contact Support so that we can take a further look at it.
[ATTACH=CONFIG]12181[/ATTACH] [ATTACH=CONFIG]12182[/ATTACH]
[ATTACH=CONFIG]12183[/ATTACH] [ATTACH=CONFIG]12184[/ATTACH]
0 Kudos