Merging multiple rasters into one

7211
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
1 Solution

Accepted Solutions
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.

View solution in original post

0 Kudos
13 Replies
DanPatterson_Retired
MVP Emeritus

merge the DEMs, fill the sinks THEN do the flowdirection...This is one of those things that you piece the bits together after, they have to be done at the beginning

0 Kudos
SepheFox
Frequent Contributor

Yeah, thanks Dan. The problem is that the script doesn't just make a flow direction. That's just one of the outputs. The original script actually starts with a DEM of the entire extent, clips it to each watershed, and yadayada.

One of the other outputs is specialized raster stream network, and I need this mosaiced together also, with the same issue right now. It is not possible to run the entire area at once, so iteration is the only option, and I need to solve the problem of gluing the raster layers all back together.

0 Kudos
DanPatterson_Retired
MVP Emeritus

clip last or if something needs to be clipped for something else...do it separately

0 Kudos
SepheFox
Frequent Contributor

Forget the flow direction. I have a script that iterates through watershed boundaries, and creates a synthetic raster stream layer from the DEM for each watershed, with specialized attributes. It is not possible to process the entire area at once. I need to mosaic the stream layers back together to take it into a future model. I know it is entirely possible as I have done it before. It's just this time something is going wrong.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Union of inputs...in Environments tab for the tool

0 Kudos
SepheFox
Frequent Contributor

Well, I want to thank you both for trying. It's looking like this might just be a display issue.

It's very odd, and I've never seen it happen before, but this is at 1:250k:

And this is at 1:40k:

Strange huh?

0 Kudos
SepheFox
Frequent Contributor

Well, after running the next step in my analysis,I have verified that the mosaic really was working as it should, but not displaying properly. I've never had this happen before, so it's a bit strange, but the important thing is that I am able to get the expected result using the layers derived from my original DEM: basically an attempt to find areas that meet "inner gorge" criteria along streams. Here is a picture of the finished product, on top of a slope layer:

Thanks again for trying to help!

0 Kudos
GabrielUpchurch1
Occasional Contributor III

Hi Sephe,

I see you already determined that the underlying data is fine and from the screenshots you provided, it appears the issue may have been with the pyramids of the mosaicked raster.  I am curious, were you mosaicking to an FGDB or SDE?  Also, what version of Desktop are using?

0 Kudos
SepheFox
Frequent Contributor

Hi Gabriel, to an FGDB, and 10.2.

0 Kudos