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

ArcGIS Help

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

Specifying input data

Available with Spatial Analyst license.

  • Input rules

All Map Algebra statements require input on which to apply the tools and operators (except for CreateNormalRaster and CreateRandomRaster, which have only optional arguments).

Input rules

  • To use input data directly (data on disk, layers, tables, field names), it must be in a quoted string.
    # The full path and nmae of the dataset is used
    outRas = Slope("C:/Data/elevation")
    
    # If the layer is in the Table of contents or in your workspace then just the quoted name is needed
    outRas2 = Slope("elevation")
    
    # In the following statement Population is a field name
    outRas2 = KernelDensity("inpoints", "Population")
    
  • Existing input data can be assigned to a variable, and the variable can be used in a statement. Variables are not quoted.
    inputElevation = "C:/Data/dem"
    outRas = slope(inputElevation)
    
  • Raster objects can be used as input into subsequent statements. Since a raster object is a variable, it is not quoted.
    outSource = ExtractByAttributes("inraster", "Value > 3000")
    
    # The output of ExtractByAttributes is used as input to EucDistance
    outDistance = EucDistance(outSource)
    
  • Result objects can also be used as input into Map Algebra expressions.
    # Buffer returns a Result object, which is used here as 
    #   input to EucDistance
    dist = EucDistance(arcpy.Select_analysis("schools", "#", "Pop>2000"))
    
  • Many tools accept multiple inputs for a parameter (multivalue input). Inputs are separated by commas and enclosed in square brackets (denoting a Python list).
    outStats = CellStatistics(["inraster1", "inraster2", "inraster3"], "MEAN")
    

Related Topics

  • An overview of the rules for Map Algebra
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