Raster Calculator Error when multiplying two rasters

6717
8
10-10-2012 08:41 AM
PeterHarrel
New Contributor
We teach a large GIS class in the fall, and we have see this problem, and many general raster problems, in the class for years using many different versions of ArcGIS.  Currently, we are running ArcGIS 10.1 on Windows 7.  The students are running the tools and saving outputs to a networked server where they have an account.  An example of this problem is a simple raster multiplication.  I have a LULC.  I want to subset this to a smaller area.  I have a mask of the smaller area composed of 1's where I want to keep values and NODATA in the background.  (the mask is a single USGS quad sheet, the LULC is for an entire watershed).  I use raster calculator to multiply the mask * LULC.  The output is subset to the extent of the mask, but it is assigned a value of zero for all pixels where the mask has values of 1. 

I can get the subset to work with the CON tool, but not the raster calculator.  It also fails when I put all the data on the local C: drive and set the scratch space to the C drive as well.  Sometimes removing the network from the situation has solved these raster problems, but not this one.  We have asked ESRI about this problem a number of times, but so far no solution.  The exact nature varies a bit from on version of ArcGIS to the next, but always these types of raster function errors.
0 Kudos
8 Replies
JeffreySwain
Esri Regular Contributor
What raster format are you outputting to?  Have you tried .tif or .img?  If you are outputting to an Esri GRID, I have seen this issue, but never been able to reproduce it in house.  The floating profiles in academic institutions seem to be part of the issue, I would also recommend trying to move the working directory to a local location as well for the processing. I also assume that you have made the necessary changes in the syntax for Raster Calculator to work.
0 Kudos
PeterHarrel
New Contributor
We do not use the GRID format at all.  GRIDS more often than not result in a failure of the tool to run (many raster tools, not just Raster Calculator).  We generally use IMG.  And I did use the raster calculator buttons and clicking on data set names to define the equation so it should not be a syntax issue.  Moving all data, input and output, to the local C drive also did no work in this case, though it is a solution we have used in the past (as I said, we have been having similar raster issues for years).  It is not a good solution even when it does work however, as we have 100 students, with greatly varying computer skills.  Copying data to the c drive and then back again when finished for 100 people is asking for trouble.  It also means other students can potentially find the finished work on the c drive and are able to copy it.  Don't want to have that temptation available, particularly when we get to the final project.  

Roaming profiles do seem to be part of the problem.  I have tried resetting the ESRI prefrences in the profile and sometimes this helps.  Mostly not though.




What raster format are you outputting to?  Have you tried .tif or .img?  If you are outputting to an Esri GRID, I have seen this issue, but never been able to reproduce it in house.  The floating profiles in academic institutions seem to be part of the issue, I would also recommend trying to move the working directory to a local location as well for the processing. I also assume that you have made the necessary changes in the syntax for Raster Calculator to work.
0 Kudos
StevenReader
New Contributor
Running 10.1 under Windows 7.

I am seeing a similar issue when simply multiplying two binary (1/0) grids together (same extent). Although there are certainly locations that should be "1" on the result (confirmed using the times tool), the raster calculator returns 0 everywhere! Meanwhile when multiplying grids with many values on each, it is fine.

This is part of a class exercise that I used under 10 (not 10.1) with no problems. Flummoxed!!
0 Kudos
carinaluo
New Contributor
I experienced similar situation when multiplying two binary raster (same extent, same cell size). The result seems odd as there are cells with negative value (e.g., -21414). I am wondering whether this is a function error associated with ArcGIS 10.1 and whether your problem has been solved. Thank you.
0 Kudos
PeterHarrel
New Contributor
I experienced similar situation when multiplying two binary raster (same extent, same cell size). The result seems odd as there are cells with negative value (e.g., -21414). I am wondering whether this is a function error associated with ArcGIS 10.1 and whether your problem has been solved. Thank you.


No solution.  Continues to be unstable.  We frequently see the results with larger negative numbers from a raster calculator function - no error message, but clearly incorrect results.  We have seen this particular problem for several years, not just ArcGIS 10.1.  If we use the 'multiply' tool instead of raster calculator when we have this happen, it works correctly.
0 Kudos
carinaluo
New Contributor
Thanks a lot for your reply, Peter. It seems that we have to use math tool instead of the raster calculator.  I hope ESRI would acknowledge this issue and solve it in the future.


No solution.  Continues to be unstable.  We frequently see the results with larger negative numbers from a raster calculator function - no error message, but clearly incorrect results.  We have seen this particular problem for several years, not just ArcGIS 10.1.  If we use the 'multiply' tool instead of raster calculator when we have this happen, it works correctly.
0 Kudos
PullarDavid
New Contributor II
I have similar situation with University computer lab and sometimes getting these inexplicable problems. On the times I have looked into it for a student, it appears that the raster calculator is giving correct result but the output statistics are messed up so it shows as negative values or large values in TOC. You can recompute statistics properties for a raster (which fixes result) but is difficult to explain to students on the occasions it does happen. I can see why ESRI could find this bug hard to track down, but at the same time we use many software packages in computer labs and do not have these problems.
0 Kudos
curtvprice
MVP Esteemed Contributor
I have a mask of the smaller area composed of 1's where I want to keep values and NODATA in the background.  (the mask is a single USGS quad sheet, the LULC is for an entire watershed).  I use raster calculator to multiply the mask * LULC.  The output is subset to the extent of the mask, but it is assigned a value of zero for all pixels where the mask has values of 1. 


Multiplying rasters can run  you into bit depth issues that make the NoData codes invalid.

I would instruct your students to use your 1/NoData grid with Extract By Mask tool, or simply set the GP mask environment to the 1/nodata grid and just enter the input raster into the raster calculator. If the point is to teach map algebra, an approach with tools like Con,IsNull,SetNull is more flexible than masking by multiplication anyway.
0 Kudos