3

I am using ArcGIS 10.3 with spatial analyst. I have a series of several rasters that I am trying to combine into a single raster layer. The rasters are all different sizes (different extents) and were produced using different sample sizes. I need to combine all these rasters using a weighted average based on sample size. Some of the rasters overlap, and others don't. At least one of the rasters is large enough to encompass all of the others. All have the same cell size and floating point values. I have tried using the Raster Calculator (i.e. (([raster1]*weight1) + ([raster2]*weight2))/sum of weights) as well as Weighted Sum. In either case, the output is reduced to the extent of the smallest raster, even when setting the processing extent to the same as the largest layer.

  1. Are these approaches (raster calculator, weighted sum) appropriate to do a weighted average and combine these rasters?

  2. What do I need to do to get the output to encompass the entire study area, and not just the extent of the smallest layer?

2
  • 1
    It is well expected that result is reduced to intersection of inputs, because result is undefined outside it
    – FelixIP
    Commented Feb 4, 2016 at 19:19
  • @Felix Yes, the result of this calculation is undefined outside the intersection, but the desired weighted mean is defined on the union of the rasters. Overcoming that disconnect is precisely the problem we are being asked to address.
    – whuber
    Commented Feb 4, 2016 at 19:47

1 Answer 1

3

Extend both the rasters and the weights to grids covering the entire area of analysis. It is essential that every NoData raster value be converted to a numeric value and that the weight in its NoData region be set to zero. These operations are best performed with Con and IsNull operations.

The weighted mean is then computed exactly as in the question: it is the sum of the [raster]*[weight] values divided by the sum of the [weight] values. Due to the previous processing, each raster contributes a nonzero value only where it has data and the final value in each cell is an appropriately weighted mean of exactly those rasters that have values for that cell.

If any cell has no values for any of the input rasters, this formula will create a divide-by-zero condition, which should place a NoData in such cells, exactly as you would hope.

1
  • 1
    +1 agree. It is also worth converting weight rasters to (0,1) and find their totals, to delineate the areas where results were derived from more than 1 input. This might very well lead to reduction of final extent
    – FelixIP
    Commented Feb 4, 2016 at 20:12

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.