Merging multiple rasters into one

7226
13
Jump to solution
04-07-2015 09:41 AM
SepheFox
Frequent Contributor

I have several flow direction rasters resulting from a python script that iterates through a watershed feature class and produces a flow direction for each one, amongst other things.

 

I need to merge these rasters into one for the next step in my process. In the past I have successfully used Mosaic to New Raster to do this, but for some reason with this group, I end up with a raster that has the combined extent of all the rasters, but only seems to have the values of one.

 

It's confusing to me, because the individual rasters only have extents of their individual watershed area, not the combined extent. I have tried using last and maximum as operators. Any ideas?

0 Kudos
13 Replies
GabrielUpchurch1
Occasional Contributor III

That's what I suspected.  There are a few known issues when mosaicking to FGDB or SDE for 10.2.x and in some cases, 10.1.  I have seen a few different symptoms, including bad pyramids, like your example, and datasets consisting of nothing but NoData values.  There appear to be multiple underlying causes but in all scenarios, it occurs with workflows that use the Mosaic or Mosaic To New Raster tools where the output is going to an FGDB or SDE.  If you do the mosaicking outside of geodatabases, such as to a tiff, the issue does not seem to occur.  The issues I am aware of were all documented and reported to Development.  I tested the issues in 10.3 last week and was unable to reproduce them so it appears they have been addressed in the latest version.

0 Kudos
SepheFox
Frequent Contributor

Oh good to know! Thanks so much. It's interesting that I've never had this issue before, although I've performed a mosaic to new raster into an FGDB many times.

0 Kudos
GabrielUpchurch1
Occasional Contributor III

It's a strange one, that's for sure.  In my experience looking into the issue, the behavior has been variable and hard to pin down.  For example, populating the "Spatial Reference for Raster" parameter in the Mosaic To New Raster tool tends to trigger it when the output is to an FGDB but when this parameter is left blank, the results tend to be fine.  In other situations, the symptoms have occurred independent of this parameter.  In any case, it's an easy one to work around if encountered.

0 Kudos
SepheFox
Frequent Contributor

Oh yes! I usually leave the spatial reference blank, and let it grab it from the inputs, but recent comments I've read on here about the importance of being explicit made me actually select the correct one in the parameter! That totally explains it then. I'm so glad to have that knowledge. Thanks again!

0 Kudos