I have 5 rasters that cover a large area. I want to combine all 5 into 1 raster. Each raster has data for portions of the total area that none of the other rasters cover.

Raster C overlaps A,B and D. While E overlaps D. No other rasters overlap each other.

On the portions that are overlapping, only certain Rasters contain the data that is needed to be displayed. The following shows which Raster are needed to be displayed.

Raster C > A

Raster C > B

Raster C > D

Raster E > D

I've tried Mosaic to New Raster, Mosaic Dataset and Mosaic (Data Management), all unsuccessful. The result is only the first Raster. The Blank area has a Value of 0, which I believe is overlapping the other rasters value when I combine them. How do I display the Values > 0 when I combine the Rasters giving priority to the values of Raster C when combined with A,B and D and Raster E when combined with D?

The edges of Raster D that overlap C and E have missing data as seen below.

enter image description here

ArcGIS 10.1, advanced arcinfo license.

Edit: I've tried all the suggestions below and here are results:

Above: This is Radouxju's suggestion using raster calculator with IsNULL, the resulting image is Raster C and I tried to overlap only D, D's area is not present. It is an exact image of Raster C.

I also tried Raster to New Mosaic with FIRST and LAST, the resulting image was the same as above, but with colour.

enter image description here

Above: This is Cody's suggestion using Mosaic Dataset and setting priorities, as you can seen the 0 Values overlap the other Rasters depending on their priority. This image is an example/ test to visualize what happens, the priorities here are B > CE > AD.


4 Answers 4


I noticed the Mosaic To New Raster tool has a Mosaic Operator setting. The default is LAST, which states the output cell value of the overlapping areas will be the value from the last raster dataset mosaicked into that location. Settings are FIRST, LAST, BLEND, MEAN, MINIMUM, and MAXIMUM. I would try other settings or reorder your rasters in the Input Rasters list.

  • Further to Michaels answer may be you mosaic C >A,B,D using LAST option only, then mosaic E>D using LAST, then mosaic those 2 resulting grids?
    – Hornbydd
    Commented Mar 24, 2014 at 14:29
  • Try the MAXIMUM setting, then the values greater than zero should come through in overlapping areas. Commented Mar 24, 2014 at 14:35
  • The MAXIMUM setting would not necessarily pick Raster C values over A,B,D and Raster E values over D.
    – JC11
    Commented Mar 24, 2014 at 15:09
  • 1
    @HornbyDD According to the rules set out in the question, it suffices that C overrides the others and E overrides D. Thus, among other solutions, FIRST (listing C first and D last) or LAST (listing C last and D first) will do the trick. MAXIMUM is inappropriate for enforcing such priorities.
    – whuber
    Commented Mar 24, 2014 at 19:59

You can do this with a mosaic dataset. Create mosaic dataset (must be inside a GDB), then "Add Rasters" and use default RasterType = Raster Dataset.

Open the attribute table, and a new field - perhaps called "priority" as Unsigned 8 bit integer. Enter numeric values for priority, where lower number = higher priority, e.g. dataset C --> priority 1 Dataset E --> Priority 2 Dataset A,B,D --> Priority 3

then set properties on MD --> find "Mosaic Method", set to "By Attribute" and then choosed Order Field = "priority". This would put C on top, then E, then A,B,D.

This will give you a virtual mosaic that can be used as a raster, but if you need to create a single raster file on disk, you would then run Copy Raster (use Environment settings to make sure your output is at the right resolution and coordinate system).

  • See above, I added an image of the result.
    – JC11
    Commented Mar 25, 2014 at 14:41

I have figured out the solution thanks to all the helpful answers and comments.

There are 2 steps:

  1. Use the Raster Calculator and SetNull: SetNULL(C==0,C) for all Rasters (A,B,C,D,E)

  2. Use Mosaic to new Raster 3 times using the Mosaic Operator FIRST in the following order:

Mosaic1: Mosaic to New Raster C > ABD

Mosaic2: Mosaic to New Raster E > C

Final Mosaic: Mosaic 2 > Mosaic 1

Explanation: C and E both over lap D, but not each other. By making a mosaic of them together I was able to overlap the patchy areas in D (first image in the question).


You could also try with the raster calculator because your images seem to be one band only (classified L7 SLC off).

so, in raster calculator, you can write

Con(  IsNull(C) , Con( IsNull(E) , abd_mosaic  , Con(E==0, abd_mosaic , E) ), Con(C==0, abd_mosaic, C )  ) 

EDITED after WHuber's commentS.

of course, you need to set the processing extent to the full extent of your 5 images.

  • This answer addresses the issue of the 0 values, but did not work as I would have expected, See edited question above.
    – JC11
    Commented Mar 25, 2014 at 14:40
  • 1
    It is likely that IsNull(C) or (C == 0) will be self-defeating, because the second term will evaluate to Null beyond the extent of C, causing the entire result to be Null beyond its extent. One way around this conundrum is first to set the zero values to nulls in all the input rasters and then proceed using only the IsNull conditions.
    – whuber
    Commented Mar 25, 2014 at 17:47
  • Thanks @whuber, I forgot that a test with null returns null and not O. Answer edited.
    – radouxju
    Commented Mar 25, 2014 at 18:51
  • 1
    I'm a little confused by your edits. For instance, the inner check first evaluates whether E is null and then, in case it is, proceeds with another Con command to check whether E is zero. Why the redundancy? It looks like all this work accomplishes little, because when E is null you return E and if not you also return E.
    – whuber
    Commented Mar 25, 2014 at 20:06
  • I must be tired :-)
    – radouxju
    Commented Mar 25, 2014 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.