Raster Extents + Calculator Problems

14356
7
06-23-2011 06:40 AM
OliverKiley
New Contributor
Hello.

I'm using ArcGIS 10 and attempting to use raster calculator to sum the values between two raster datasets. 

However, the extent of of one of the rasters is much smaller than the other, so the output extent is only ever the smaller extent. How do I increase the extent of the smaller raster so that the output is consistent with the entire/larger raster?

I've tried changing the processing extents in the environment options, but that doesn't work either.

Thank you,

~Oliver
0 Kudos
7 Replies
EricRice
Esri Regular Contributor
Oliver,

When summing rasters with different extents, the normal behavior is to output just an area where the two can actually be summed together.  Hence, you see the output has the extent derived from the smaller of the two inputs.  How you manage this situation depends on what your desired output is.  For example, if you want the output to sum where they overlap, but return the original value from the larger dataset (non overlap area), then you have to use a Con(IsNull) statement.  Ideally, your data should have the same cell size, same extent, and be snapped to the same underlying grid via setting a snap raster somewhere prior in your workflow.

Something to think about.
Pixel value + NoData Pixel = NoData Pixel
Pixel value + 0 = Pixel value
Pixel value + Nothing (because your extents are different) = Nothing.

What would you like the output values to be for the non overlapping areas?

Regards,
Eric
0 Kudos
OliverKiley
New Contributor
Oliver
....
What would you like the output values to be for the non overlapping areas?

Regards,
Eric


Thanks for the reply.

I'm doing a number of neighborhood statistics operations on different raster layers created by converting features into rasters.  Ultimately these raster layers will be combined using a suitability/weighting process.  When creating the rasters from features, the resulting raster extent is only as big as the selected features extent, hence the size difference.

Is there a way to manage the raster extent when converting from feature to raster in this way?

If I'm just doing a simple raster operation like "[RasterBIG] + [RasterSMALL]" where does the the Con(IsNull) statement go?

In cases where there isn't overlap, the reuslting values should just be taken from larger raster.

Thanks!
0 Kudos
JeffreySwain
Esri Regular Contributor
To echo what Eric said, you will have to make NoData values for the smaller raster to be 0.  So you must recopy the smaller raster and specify a spatial extent to match the larger raster. Then the Con statement to convert the NoData pixels to 0 can be used.  If there is a null value in the equation the product will be ignored. 

So utilize the spatial extent of the largest raster when converting and then use the Con statement.  So the empty NoData areas will be converted to 0 and when the rasters are added you will only have the value of the larger raster.
0 Kudos
OliverKiley
New Contributor
To echo what Eric said, you will have to make NoData values for the smaller raster to be 0.  So you must recopy the smaller raster and specify a spatial extent to match the larger raster. Then the Con statement to convert the NoData pixels to 0 can be used.  If there is a null value in the equation the product will be ignored. 
....


I've already set the NoData values to zero.  How do I "specify a spatial extent to match the larger raster"? What tool am I supposed to use to do this?
0 Kudos
EricRice
Esri Regular Contributor
Let me try to get to these questions individually from most recent post to earlier ones.

Q: I've already set the NoData values to zero. How do I "specify a spatial extent to match the larger raster"? What tool am I supposed to use to do this?

A:  The tool is called Copy Raster.  In the tool dialog you need to click on the Environments button.  Set the Output Extent to your largest raster, or your study area boundary, or whatever you used to define the extent of the project.  For this isolated case make sure you set the snap raster to be the largest raster (the same as the one used for output extent).  Once you have increased the number of NoData pixels in the data (by increasing its extent) you will have to set those to zero as well, so please repeat whatever method you used to set NoData to zero.

Syntax:
Con(IsNull("raster"),0, "raster")

Comment:  It's not a requirement to convert NoData to a value of 0.  Thats what we have Con(IsNull() for.

Q:   When creating the rasters from features, the resulting raster extent is only as big as the selected features extent, hence the size difference.  Is there a way to manage the raster extent when converting from feature to raster in this way?

A: Yes.  When converting the features to raster go into the Environment Settings and set the Output Extent, Snap Raster, and Cell Size parameters .  This will ensure each resulting raster has the same extent, cell size, and that the pixels exactly align with one another (see Snap Raster).  Doing this step during the conversion process will make summing the rasters later a lot easier.


Q:  If I'm just doing a simple raster operation like "[RasterBIG] + [RasterSMALL]" where does the Con(IsNull) statement go?

A:  Con(IsNull() is used for specific scenarios, like when someone doesn't want to convert NoData to 0 (zero) before doing some arithmetic.  To be specific about where to put the statement let me outline my assumptions:

1. RasterBIG and RasterSMALL have the same extent, cellsize, and have exact pixel alignment.
2. RasterSMALL has fewer 'real' data pixels when compared with RasterBIG.
3. NoData has not been converted to zero.

The statement would go like this:  Where RasterSMALL is null, give it the value of RasterBIG; where RasterSMALL is not null, add RasterSMALL to RasterBIG.

Con(IsNull("RasterSMALL"),"RasterBIG, ("RasterSMALL" + "RasterBIG"))


Good luck and let us know if you have any follow up questions!

Regards,
Eric
0 Kudos
ClaireBrittain
New Contributor
Great, thanks a lot for your help. I got there eventually. I kept thinking that when I copied the raster and changed the extent settings to the larger raster size that it wasn't working but it was just that I couldn't see that it had increased in size until I went into the calculator and set the null values to zero. Then I could see the raster size had been expanded and I was able to use the combine tool just how I wanted.
Thanks again.
Claire
0 Kudos
JasonAdelaars1
New Contributor
Hi

I've been having the problems with the same process, except Iam trying to sum 11 overlapping rasters and Im working in Arc10 (which has new python syntax).  I've already reset all the raster extents and snapped them to the largest raster.  Now im having trouble with the Con(SetNull() statement to set the NoData values to zero and sum them.  Looking for guidance. 

Thank you,
Jason
0 Kudos