I have about 100 rasters of water occurrence that I have used to create a mosaic dataset. The pixel values in the rasters range from 0 to 1. The pixel values in the mosaic range from 0 to 0.26... this appears to match the range found in the first raster added to the mosaic dataset. The pixel values in each raster appear to have been rescaled to match this new scale. I need the mosaic to keep the original pixel values in the rasters.

This seems like a basic error, but I've gone through the arcpy documentation and I can't figure out what I need to change. I'm hoping someone can point out where I'm going wrong.

My workflow is as follows:

# create mosaic dataset
mdname = 'occ_'+da+'_2'
spatialref = "4326"
noband = "1"
pixtype = "32_BIT_FLOAT"
pdef = "NONE"
wavelength = ""
arcpy.CreateMosaicDataset_management(outPath + gdb, mdname, spatialref,
     noband, pixtype, pdef, wavelength)

# add rasters to mosaic dataset
inpath = tifPath
rastype = "Raster Dataset"
updatecs = "UPDATE_CELL_SIZES"
updatebnd = "UPDATE_BOUNDARY"
updateovr = "UPDATE_OVERVIEWS"
maxlevel = "2"
maxcs = "#"
maxdim = "#"
inputdatafilter = "*.tif"
subfolder = "NO_SUBFOLDERS"
buildpy = "NO_PYRAMIDS"
buildthumb = "NO_THUMBNAILS"
comments = "Add Raster Datasets"
mdname = outPath+gdb+"/"+mdname

arcpy.AddRastersToMosaicDataset_management(mdname,  rastype, inpath,     
    updatecs, updatebnd, updateovr, maxlevel, maxcs, maxdim, spatialref,
    inputdatafilter, subfolder, duplicate, buildpy, calcstats, buildthumb,
    comments, forcesr)

My rasters do not overlap, so this is not caused by the mosaicing rules

  • 1
    What makes you think that raster values have been rescaled, how do you check each raster's value range? By default the first added raster is on top, so if your rasters overlap you will see the first raster's value for a pixel. You can apply mosaicking rules if you want another value to appear on top. You can also apply functions if you want e.g. the average or maximum pixel value. – GISGe Aug 17 '17 at 9:19
  • See my above edit regarding overlaps. I know that the mosaic values are not the same as the original by comparing the two datasets - the mosiac pixel value is 0.26 while the pixel value in the original raster is 1. – Kim Aug 17 '17 at 11:07
  • There isn't one value per pixel in a mosaic. For a given pixel there are as many values as the number of rasters in the mosaic. Now, one of the values is shown on top, depending on the mosaicking rules (some rasters or raster parts have a higher priority). See here to understand how mosaicking rules work. – GISGe Aug 17 '17 at 11:53
  • My understanding is that the mosaiking rules control what happens when rasters overlap. None of my rasters overlap, so there shouldn't be more than one value per pixel. – Kim Aug 17 '17 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.