Institute for Geographic Information Science at San Francisco State University
GISc Help Desk - Knowledge Base
The following are some questions we commonly we receive concerning the use of ESRI and Leica software products, as well as, entries referenced from ESRI and Leica support directly. Please give us feedback if you don't see an answer to your question.
Browse for Questions
Product List > ArcInfo Desktop > Spatial Analyst
Why are the options on the 3D and/or Spatial Analyst toolbars greyed out?
The extension has not been activated. In ArcGIS, you can add any desired toolbar to the GUI. However, a few require the activation of an extension, similar to that found in ArcView 3.x.

Navigate to Tools > Extensions, check the necessary extension(s), and click Ok.

Can I access recently used expressions in the Raster Calculator?
Yes, recently used expressions can be accessed in Raster Calculator (especially useful when you need to access the same expression multiple times). Right-click inside the expression box and click Recent Expressions. Copy\paste expressions into the expression box.
What are the supported operators in the Raster Calculator (Map Algebra)?

The table below lists all supported operators in the Raster Calculator. A brief description follows along with the corresponding precedence value.

The precedence value determines the priority of processing for each operator. The larger the precedence number assigned in an operator, the higher its priority, and thus, the sooner the Spatial Analyst interpreter will process it. The Spatial Analyst interpreter processes the operator with the highest priority first, the second highest second, and so on.

[inlayer1] + [inlayer2] div [inlayer3]

In the above expression, the negative of inlayer1 is first calculated, then inlayer2 is divided by inlayer3 and finally, the two temporary resultant grids are added together (the result of - inlayer1 + the result of inlayer2 div inlayer3).

Operators with the same precedence level are processed from left to right.

[inlayer1] * [inlayer2] div [inlayer3]

To process the above expression, the Spatial Analyst interpreter will first multiply inlayer1 with inlayer2 and divide the result by inlayer3.

The left-to-right rule applies to all operators, except for shift operators (<< and >>) with precedence level 7 and unary operators (unary -, ^, and ^^) with precedence level 12. These two operators have a right-to-left association.

^ ^^ [inlayer1]

First the bitwise complement (^^) of inlayer1 is calculated, then the Boolean complement (^) is taken from the results of the bitwise complement and finally, the unary minus is determined from the previous resultant grid.

Can the Working Directory location have a space in the path name?

When you use the spatial analyst various temporary files are generated in the construction of some output datasets. You might recall that you have been informed to never have spaces in the names of files or directories for any ArcGIS data. Well by default the working directory for Spatial Analyst can be a "home" directory for your username that does have spaces in it. If you get this error message:

"The Working Directory location can not have a space in the path name.
Please specify a new location"

then do this:

From the Spatial Analyst menu select Options. Under the General tab enter the following for "Working directory": D:\TEMP

This is a directory that all users should have write access to and so should allow ArcGIS to create the temporary files needed for some Spatial Analyst operations.

How do you find the number of points in a grid using Spatial Analyst
The following steps demonstrate how to find the number of points that fall within each cell of a grid.

Requires:
Grid with the cell size desired for analysis.
Point theme with a column that has the number 1 as its attribute for every record.
  1. Select Spatial Analyst > Options to call up the 'Options' dialog box.
  2. Select the grid as the Analysis extent, the Analysis cell size and the Analysis mask.
  3. Click OK
  4. Activate the point theme.
  5. Select Spatial Analyst > Neighborhood Statistics to call up the 'Neighborhood Statistics' dialog box.
    1. Select the Input data: The point theme.
    2. Select the Field: The one that contains the value of 1 for each record.
    3. Select the Statistic type: Sum
    4. Select the Neighborhood: Rectangle
    5. Height: 1
    6. Width: 1
    7. Select Units: Cell
Verify that the 'Output cell size' matches that of the input theme of choice.
How do you clip a multiband image using ArcGIS and Spatial Analyst
Instructions provided explain the procedure to clip or sub-set a multiband image. The Spatial Analyst extension is required.

To use this procedure a masking dataset that covers the area to be clipped is required. The dataset may be a raster or a polygon feature class and should be in the same coordinate system as the raster being clipped.
  1. Add the individual bands of raster to ArcMap. Do not add the raster as a multiband. Each band should be its own separate layer in ArcMap's Table of Contents.
  2. Add the masking dataset to ArcMap.
  3. Navigate to Spatial Analyst > Options.
  4. On the General tab set the Working Directory.

    The path to the Working Directory may not have any spaces. For example, a folder called 'My Documents' may cause an error, but 'My_Documents' does not.

  5. On the General tab set the Analysis Mask to the masking dataset.
  6. On the Extent tab set the extent to the masking dataset.
  7. On the Cell Size tab set the cell size to the clipping raster.
  8. Click OK.
  9. Open Spatial Analyst > Raster Calculator.
  10. Double-click on the first band in the Layers list. This will put the band into the expression box below.
  11. Click Evaluate. A new calculation layer will be added to ArcMap's Table of Contents.
  12. Repeat Steps 10 and 11 until all bands of the raster have been clipped.
  13. Right-click on each new calculation layer and save it to a raster dataset with Make Permanent.
  14. Open Spatial Analyst > Raster Calculator.
    Use the MAKESTACK function to make an ESRI Grid Stack from the calculation layers.

    MAKESTACK <outstack> LIST <band1> <band2> <band3>

    Where <outstack> is a name for the output stack and <band1>, <band2>, <band3> are the calculation layers.
  15. Optionally, the output stack may be converted to a TIFF, IMG or ArcSDE Raster in ArcCatalog.
How do you mosaic multiband images using ArcGIS and Spatial Analyst
Steps to mosaic multiband images in ArcGIS using the Spatial Analyst extension (required).
  1. Start ArcCatalog and navigate to the raster of choice.
  2. Right click on the raster and select Export > Raster To Different Format...
  3. Save as an ESRI GRID.

    This process will create a grid for each band in the image. The grids will be distinguished by a "c + number" suffix. For example, image1 will export to image1c1, image1c2 and image1c3. A grid stack with the root name of the other output grids will also be created.

  4. Start ArcMap and add the grids representing the bands of data to a data frame.
  5. Select Raster Calculator from the Spatial Analyst pull-down menu
  6. Use the MOSAIC command in Raster Calculator to mosaic the data together.
    Here is an example of the syntax:

    [Band1] = MOSAIC([ImageName1],[ImageName2],[ImageName3])

    [Band1] is the name of the output grid; a permanent grid will be created on disk called Band1. This step will need to be done for each band.

    ImageName1 refers to the output raster from band1 of the first image. ImageName2 and ImageName3 refer to the output rasters from the first band of images 1 and 2, respectively.

  7. Use the MAKESTACK command in the Raster Calculator to create a grid stack from the mosaiced bands. Here is an example of the syntax:

    MAKESTACK newstack LIST [Band1] [Band2] [Band3]

    "Newstack" will be the name of the output stack. There are no parentheses or commas used with this command in the Raster Calculator.

    The word "LIST" should be omitted when using the MAKESTACK command in version 8.1.2

  8. Navigate to the directory containing the new grid stack in ArcCatalog.
  9. Right click on the grid stack and select Export. Choose Raster to MrSID if you need this format or Raster to Different Format. The Raster to Different Format utility will allow you to create TIFF's or ERDAS Imagine image files.
Index: Operation Failed [Index of common causes]
Below is a list of all common causes that may generate the error message:

"Operation Failed"

The ESRI articles below address the various causes, and provide a workaround when available. Please note that it may be necessary to log on to our support site before viewing some of these articles.

Topics
Operation Failed [loading raster]
Attempting to load a raster with a data depth of two bits fails with this error message: “Operation Failed”

Operation Failed [using Shortest Path function]
The Shortest Path function in Spatial Analyst, when using the output distance and direction rasters generated by the Straight Line Distance function, returns the message: "Operation Failed"

Operation Failed [using Zonal Statistics]
When running the Zonal Statistics function in Spatial Analyst, the following error message may occur: "Operation Failed"

Operation Failed [setting Create Allocation]
The Straight Line tool in Spatial Analyst fails with this error when setting Create Allocation: "Operation Failed"

Operation Failed [using Density function]
The Spatial Analyst Density function returns the following message: "Operation Failed"

Operation Failed [using Interpolate to Raster functions]
The Spatial Analyst Interpolate to Raster functions return the following message: "Operation Failed"
How do I make a temporary dataset permanent?
By default most results from analysis are temporary. Exceptions are the conversion functions and functions that do not output raster data. In these cases, results will be permanent by default.

Results from all other functions can be made permanent three ways:
  • By supplying a name for the output in a function dialog box.
  • By creating a temporary result and then making that result permanent
  • By saving the map document, which makes all temporary results permanent in the specified workng directory, using the default output names.

Tip
Set your working directory by navigating to Spatial Analyst toolbar > Options > General tab and set up your working directory for analysis.

     Services
     Training
     Staff
     Research
     Academic
     Help Desk
     Data
     Software
     Links
     Networking
     CSU GIS Center
     Geography
     BSS Computing
 

  Institute for Geographic
  Information Science

  1600 Holloway Avenue
  San Francisco, CA 94132
  Phone: (415) 338-3566

 
   
San Francisco
State University