Raster Calculator Merge Function in ArcGIS 10?

23494
12
04-14-2011 12:44 PM
MichaelDulin
New Contributor II
I'm trying to merge DEM grids using raster calculator.
Is there a command to merge rasters using raster calculator in ArcGIS 10? In 9.3 the command worked like this: Merge ([dem1], [dem2], [dem3])

That command doesn't seem to work since the switch to python script.....

Thanks for any advice.
12 Replies
Robert_LeClair
Esri Notable Contributor
Hello,

You could simply add the rasters together in the raster calculator.  For example "InRaster1" + "InRaster2" + "InRaster3" and define the output as a new raster dataset.

Cheers,

Robert LeClair
Esri-Denver
0 Kudos
JeffreySwain
Esri Regular Contributor
Not necessarily.  The add will only work if the spatial extent is set and there are values for the NoData areas.  If there are not any values there, the Add will only return the intersection of the two rasters.  You would have to make the spatial extents match and then change the nodata values to 0 rather than null and then when you add them, the raster would look appropriate.  

I would recommend using the Mosaic to New Raster Tool in Data Management > Raster > Raster Dataset to complete the process since the 'merge' functionality is no longer available in Raster Calculator. 

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000098000000.htm
JamieKass
Occasional Contributor
You could also do this:

Con(IsNull("raster1"),0,"raster1") + Con(IsNull("raster2"),0,"raster2")

It basically says "if a cell is null, make it 0, then add them".
zhaojunwang
New Contributor II

it works for me. Thanks

0 Kudos
EricRice
Esri Regular Contributor
The old Merge command has nothing to do with arithmetic.  It is (was) a mosaic operation.

-Eric
0 Kudos
WillBreitkreutz
New Contributor
Not necessarily.  The add will only work if the spatial extent is set and there are values for the NoData areas.  If there are not any values there, the Add will only return the intersection of the two rasters.  You would have to make the spatial extents match and then change the nodata values to 0 rather than null and then when you add them, the raster would look appropriate.  

I would recommend using the Mosaic to New Raster Tool in Data Management > Raster > Raster Dataset to complete the process since the 'merge' functionality is no longer available in Raster Calculator. 

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000098000000.htm


This is absolutely ridiculous, taking away the flexibility and usability of raster calculator combined with the old arcInfo functions was one of the worst design flaws of Arc10...
0 Kudos
SteveLynch
Esri Regular Contributor
Why not use CellStatistics with the ignore_nodata
option.

Steve
milansmart
New Contributor II

Yeah, very simple and useful tool, I can't believe I didn't know it 😄 Thanks a lot!

0 Kudos
curtvprice
MVP Esteemed Contributor
This is absolutely ridiculous, taking away the flexibility and usability of raster calculator combined with the old arcInfo functions was one of the worst design flaws of Arc10...


Most of the Spatial Analyst tools are available in the new Raster Calculator. Mosaic and Mosaic To New Raster are not Spatial Analyst tools, so unfortunately they don't work in Raster Calculator.

I also miss the old Merge local function ("grab the first non-Nodata value in the list of rasters, cell by cell) and would like to see either its return or a method to replicate it using the current functions in 10.0. It was a nice simple operator that did a simple thing -- tools like that are handy in map algebra when you're trying to solve a complex problem! (Now that I think about it, adding a FIRST and LAST statistics to Cell Statistics would be an easy way to implement Merge without adding another function. Good idea for ideas.esri.com!)