ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

WSTable

Available with Spatial Analyst license.

  • Summary
  • Discussion
  • Syntax
  • Properties
  • Code Sample

Summary

Defines the input rasters and their weights which will be added together in the WeightedSum tool.

Discussion

The Weighted Sum tool uses the WSTable object.

Input rasters can be integer or floating point.

The weight values can be any positive or negative decimal value. The weights do not need to add to any specific value such as 100 (representing each raster's percent influence).

Syntax

 WSTable (weightedSumTable)
ParameterExplanationData Type
weightedSumTable
[[inRaster, field, weight],...]

The table specifying the input rasters, the fields to use for the values for each raster, and the weight by which to multiply each raster.

  • InRaster—Is the raster being weighted (data type: string).
  • field—The field in the raster to use for the input values (data type: string).
  • weight—The weight value by which to multiple the raster (data type: double).

List

Properties

PropertyExplanationData Type
weightedSumTable
(Read and Write)

Contains the weighted sum table specifying the rasters to be added, the fields identifying the values to use for each raster, and the amount of influence each raster will have in the addition.

List

Code Sample

WSTable example 1 (Python window)

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

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myWSumTable = WSTable([["snow", "VALUE", 0.2], ["land", "VALUE", 0.3], ["soil",
                    "VALUE", 0.5]])
outWSumT = WeightedSum(myWSumTable)
outWSumT.save("C:/sapyexamples/output/wsumtable")
WSTable example 2 (stand-alone script)

Performs a weighted sum analysis using the WSTable class.

# Name: WSTable_Ex_02.py
# Description: Demonstrate executing WeightedSum using the WSTable object.
# 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
inRaster01 = "snow"
field01 = "VALUE"
weight01 = 0.25
inRaster02 = "land"
field02 = "VALUE"
weight02 = 0.25
inRaster03 = "soil"
field03 = "VALUE"
weight03 = 0.5

# Define WSTable 
myWSumTable = WSTable([[inRaster01, field01, weight01], [inRaster02, field02,
                        weight02], [inRaster03, field03, weight03]])

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute WeightedSum
outWSumT = WeightedSum(myWSumTable)

# Save the output 
outWSumT.save("C:/sapyexamples/output/wsumtable2")

Related Topics

  • An overview of Spatial Analyst classes
  • An overview of overlay classes
  • Understanding overlay analysis
  • Overlay analysis approaches
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal