WOTable (arcpy.sa)

Summary

Defines the input rasters, the field identifying the input values, the remap of their values, the weight of each raster, and the evaluation scale to use in the Weighted Overlay tool.

Discussion

The Weighted Overlay tool uses the WOTable object.

For each value in an input raster identified in the WOTable object, the Weighted Overlay tool assigns a new value based on a remap object. The two remap classes that are available are RemapValue and RemapRange. However, since WOTable generally works with categorical data, the RemapValue object is the recommended input.

In the Weighted Overlay tool each input raster in the WOTable object is weighted according to its importance or its percent influence, which is also defined in the object. The weight is a relative percentage, and the sum of the percent influence weights must equal 100 percent.

The from, to, and by evaluation scale parameters have no effect on the resulting calculations but are necessary input.

Syntax

WOTable (weightedOverlayTable, evaluationScale)
ParameterExplanationData Type
weightedOverlayTable
[[inRaster, influence, field, Remap],...]

The table specifying the input rasters, their influence, the field to use, and the remap table identifying what the old values should be remapped to.

  • inRaster—The input raster criteria being weighted.
  • influence—The influence of the raster compared to the other criteria (data type: double).
  • field—The field of the criteria raster to use for weighting (data type: string).
  • Remap—The Remap object identifies the scaled weights for the input criterion.

In addition to numerical values for the scaled weights in the remap table, the following options are available:

  • RESTRICTED—Assigns the restricted value to cells in the output, regardless of whether other input rasters have a different scale value set for that cell.
  • NODATA—Assigns NoData to cells in the output, regardless of whether other input rasters have a different scale value set for that cell.
List
evaluationScale
[from, to, by]

The range and interval for the new values in which to remap the old values. The parameter is required for both the dialog box and scripting but it has no effect in scripting.

  • from—Is the lowest value to use for the new values (data type: double).
  • to—Is the highest value to use for the new values (data type: double).
  • by—Is the interval between the new remap values (data type: double).
List

Properties

PropertyExplanationData Type
weightedOverlayTable
(Read and Write)

Contains the weighted overlay table identifying the rasters to be remapped, the amount of influence of each raster, the values to be remapped, and the values to remap them to.

List
evaluationScale
(Read and Write)

The range and interval for the new values by which to remap the old values.

List

Code Sample

WOTable example 1 (Python window)

Demonstrates how to create a WOTable class and use it in the WeightedOverlay tool within the Python window.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myWOTable = WOTable([["snow", 50, "VALUE", RemapValue([[0, 1], [1, 1], [5, 5],
                    [6, 6], [7, 7], [8, 8], [9, 9], ["NODATA", "NODATA"]])],
                    ["land", 20, "VALUE", RemapValue([[0, 1], [1, 1], [5, 5],
                    [6, 6],[7, 7], [8, 8], [9, 9], ["NODATA", "NODATA"]])],
                    ["soil", 30, "VALUE", RemapValue([[0, 1], [1, 1], [2, 2],
                    [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9],
                    ["NODATA", "NODATA"]])]], [1, 9, 1])
outWeightedOverlay = WeightedOverlay(myWOTable)
outWeightedOverlay.save("C:/sapyexamples/output/woverlaytbl")
WOTable example 2 (stand-alone script)

Performs a weighted overlay analysis using the WOTable class.

# Name: WOTable_Ex_02.py
# Description: Uses the WOTable object to execute WeightedOverlay tool.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster1 = "snow"
inRaster2 = "land"
inRaster3 = "soil"

# Define WOTable 
myWOTable = WOTable([[inRaster1, 50, "VALUE", RemapValue([[1, 1], [5, 5],
                    [6, 5], [7, 5], [8, 9], [9, 9], ["NODATA", "NODATA"]])],
                    [inRaster2, 20, "VALUE", RemapValue([[1, 1], [5, 5],
                    [6, 5], [7, 5], [8, 9], [9, 9], ["NODATA", "NODATA"]])],
                    [inRaster3, 30, "VALUE", RemapValue([[1, 1], [2, 1],
                    [3, 1], [4, 5], [5, 5], [6, 5], [7, 9], [8, 9], [9, 9],
                    ["NODATA", "NODATA"]])]], [1, 9, 1])
 
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute WeightedOverlay
outWeightedOverlay = WeightedOverlay(myWOTable)

# Save the output 
outWeightedOverlay.save("C:/sapyexamples/output/woverlaytbl2")

Related Topics

3/7/2014