I made a four rasters in Raster Calculator with plans to mosaic them to one raster. One of the four resulted in an 8 bit unsigned pixel type. The others are 16 bit signed. I can't mosaic these rasters and I am guessing the different pixel type is the reason. I did check the projection, which is usually my problem, but that is not the problem.
The calculator script was
(<raster_#> * 100) + raster_b
The 8 bit raster came from a raster_# that had 3 values while the other raster_# had four values in the grid and I am guessing that this is causing the different pixel type in the results. I saw this thread and so I tried Copy Raster(Data Management) with the 8 bit result by setting the optional Pixel Type to 16 bit signed, but that still resulted in an 8 bit pixel depth. How can I get these rasters into one mosaic?
Solved! Go to Solution.
The rasters' NoData Values:
raster_1 (8 bit unsigned): 255
raster_2 (8 bit unsigned): 255
raster_3 (8 bit unsigned): 255
raster_4 (8 bit unsigned): 255
raster_b (8 bit unsigned): 2147483648
raster_1 is the one with only 3 values and that's the one that results in the 8 bit unsigned raster that keeps from mosaicing.
I added a screen print of what I have for inputs for Copy Raster.
Something in my head just clicked. When raster_1 gets multiplied by 100, the highest value is 203. When raster_2 is multiplied, it's lowest value is 301 and the other rasters only get higher from there. I was not paying attention to the range of values covered by 8 bits versus 16 bits. I thought 8 bit pixel type was something else (don't know what what would have been) than a way to cover the range of grid values. (But that doesn't seem to explain the extremely high NoData Value for raster_b. Whatever.) I guess I should multiply my rasters by 1000 in Raster Calculator, this way they will all be in a 16 bit value range, 2000-7003, instead of the 201-703 that they are now when I multiply by 100.
Thanks for your time, Dan. I did not understand what you meant at first by promotion, but it's a bit more clear now.
An potential alternative:
Would Copy Raster (Data Management) work better than using Raster Calculator? In Copy Raster, there is a Pixel Type (optional) setting that looks like it could be used to control the output.
Pixel type (Optional)
Determines the bit depth of the output raster dataset. If left unspecified, the output bit depth will be the same as the input.
There will be no rescaling of the raster values when a different pixel type is chosen. If the pixel type is demoted (lowered), the raster values outside the valid range for that pixel depth will be truncated and lost.
Source: Copy Raster (Data Management) h
EDIT - scratch that - it looks like you already tried that.
Chris Donohue, GISP
I don't think the different pixel type cause the failure of Mosaic. It works well for me adding 8bit unsigned, 16bit signed and also 32bit float to MosaiC Dataset. So there must be other reasons. I agree with Professor Dan Patterson.