Select to view content in your preferred language

Raster Calculator - Mathematical Operation

1412
1
02-01-2011 09:26 PM
DwightLanier
Occasional Contributor
Hi All,

I have several multiple observer viewsheds created in ERDAS and saved out as .img files.  I broke up the area to be covered into segments that overlap to reduce file size and make the viewsheds run, and need to add them all together to get one final surface that shows number of observers that can see each location.

After a reclass in ArcGIS the pixel values represent the number of observers that can see each location without the hidden, boundary, etc. classes that ERDAS encodes into the viewsheds.  If I use the indentify tool, the returned pixel value is the correct number.  The problem comes when trying to use raster calculator to add all of the rasters together.  Whether I add two of the files together, or all 5, the resulting values are not the simple 1 - 5 observers that I would expect to get.  Instead, where the two rasters do not overlap I get values in the 400s and 500s.  I tried multiplying the rasters by 1.0 to see if this would solve the problem, but it doesn't.

Is this a problem with the file format not being compatible?  I would think that a simple summation over each cell location would work fine.

Thanks for any suggestions and time.

Dwight
0 Kudos
1 Reply
DwightLanier
Occasional Contributor
Because the rasters were created in ERDAS, my guess is that somehow has an affect on the values being interpreted as unique color values.

Example:  raster A is overlaped by about a quarter of its area in the upper right corner by the lower left quarter of raster B.  When A and B are added together, correct values are populated only where they overlap.  If you look at the complete spatial extent of the union of both rasters, any area not covered by both rasters has a value of 255 added to it.  This is the upper end of an 8-bit color range.  I have no idea why these areas are being populated with 255 instead of nodata or 0 when multiple layers are added together.

Problem was fixed by creating a final total spatial extent ratser of all inputs, reclassing this to zero, then adding it to each input raster to fill in values that lay outside the original extent of the input, and then a final reclass to set the 255 to 0.  I did two of these and added them together and the output had correct results for all cells.

Now the question would be why does a cell get a value of 255 if it was a location where two input rasters did not overlap?

Thanks,
D
0 Kudos