Skip navigation
All Places > GIS > Analysis > Spatial Analyst > Blog
1 2 Previous Next

Spatial Analyst

16 posts

ArcGIS Pro 2.3 and ArcMap 10.7 Spatial Analyst tools now support a new environment, the Cell Size Projection Method, to control the calculation of the output raster cell size when datasets are projected during tool execution. To learn more about projections, see Coordinate systems, projections, and transformations.

In previous software versions, the cell size was converted using a linear unit conversion when projecting from a Projected Coordinate System (PCS) to another PCS or an angular unit conversion when going from Geographic Coordinate System (GCS) to another GCS. So, projecting a 30 meter raster dataset from UTM zone 10N to WGS84 Web Mercator would continue to use 30 meter as the output cell size. When projecting from GCS to PCS or vice versa, previous versions took an average cell size based on the ratios of diagonal lengths in source and destination projections. Therefore, this method, currently exposed as the ‘convert units’ method simply copied the cell size from input to output, changing units if necessary.

This approach has some limitations:

  • It does not account for distortion when projecting from one PCS to another PCS (1 projected meter in, say, a UTM zone at a given location may not cover the same ground distance as 1 projected meter at the same location in an Albers projection).
  • When computing the ratios of diagonal lengths, the behavior of the projection at only the four corner points was used. This may have introduced excessive distortion, depending on the projection and the extent.

The two new methods: ‘preserve resolution’ and ‘center of extent’ both are intended to calculate a projected cell size that doesn’t change the ground distance of the cell, thus avoiding unnecessary resampling during an implicit projection operation happening as a Spatial Analyst tool or a feature to raster conversion tool executes. You should use the ‘center of extent’ method when you know the geographic location where your cell size is most accurate. If you use this method, you can use a raster with a small extent in that same area as the cell size source or create a temp raster ‘around’ that location and use that as the cell size source. If you are unsure, use the ‘preserve resolution’ method. To learn more about the three cell size projection methods see How the Cell Size Projection Method environment setting works.

If you do not know at which specific geographic location your cell size is best but want to improve on the ‘convert units’ method when a projection is involved while working with Spatial Analyst tools, you can use the ‘preserve resolution’ method.

Why use the resolution preserving cell size projection method?

In the ‘preserve resolution’ method the same number of square cells as are in the original extent are preserved in the projected extent. The output cell size is calculated based on the ratios of the areas of the projected extent to the original extent. This approach is based on how Esri software currently chooses a cell size when moving from a camera image coordinate system to a geodetic (GCS or PCS) system. This method calculates the average size of a square cell more accurately for all combinations of GCS and PCS than the default ‘convert units’ method.

If the areas of the original rectangular extent and (shape preserving) projected extent are A0and A1, then the areas of the square cells, respectively, are, ca0 = A0/n and ca1 = A1/n

Since the number of cells remains constant for both cases, the ratio of the area of extent to the area of the square cell are equal, A0/ca0 = A1/ca1

Figure 1: Cell size projection using the new ‘preserve resolution’ method

Figure 1: Cell size projection using the new ‘preserve resolution’ method


So, the output cell area is ca1 = (A1/A0) * ca0

and the output cell size is CellSize_projected = √((A1/A0) * ca0)

In this method, the cell size conversion factor is, √(A1/A0)

Let’s look at two examples to see how the ‘preserve resolution’ method picks a better output cell size than ‘convert units’.

Example 1:

Let’s take an elevation raster (R_input), located in Vermont (Figure 2), in a PCS (NAD_1983_StatePlane_Vermont_FIPS_4400) and project it to another PCS (WGS 1984 World Mercator) using the default cell size projection methods, ‘convert units’ (R_out_CU) and ‘preserve resolution’ (R_out_PR). Here both the spatial references are shape preserving, where the input spatial reference is suitable at a state level and the output spatial reference is suitable for the entire world. We will then compare the geodesic distance between the cell centers to determine which method preserves the geodesic distance more accurately.


Figure 2: Location of the input raster (R_Input), its cell boundaries and cell centers.

Figure 2: Location of the input raster (R_Input), its cell boundaries and cell centers.


Before we compare the geodesic distances between the two methods, lets understand what are the different ways a raster is projected in ArcGIS Pro. When you add a raster to the map in ArcGIS Pro, the spatial reference of the map becomes the same as the spatial reference of the raster. For example, if the first layer added has a NAD_1983_StatePlane_Vermont_FIPS_4400 PCS, the map will have the same spatial reference, and all other layers will project on the fly to match this spatial reference. This on-the-fly raster projection is meant for a richer display experience but does not preserve the raster structure (different cells can have on-the-fly-projected different sizes, rotations, and distortions). However, when you project a raster using the Project Raster tool or specifying the Output Coordinate System environment of a geoprocessing tool, the raster is actually  projected into a new raster structure (every cell is an identical rectangle in the output spatial reference, with sides parallel to the coordinate system axes). When measuring geodesic distance for the comparison of the cell size projection methods, it is recommended to use the actual projected raster instead of the raster that is projected on the fly.

In figure 3, the cell size of the input raster, R_input is 30 meters. This is approximately the same as its geodesic ground distance, which you can find out using the Measure tool in ArcGIS Pro.


Figure 3: Cell boundaries of R_input, cell centers of R_input, R_out_CU, R_out_PR and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input for comparison.

Figure 3: Cell boundaries of R_input, cell centers of R_input, R_out_CU, R_out_PR and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input for comparison.


When the raster is projected using the ‘convert units’ methods, the projected cell size of the output raster, R_out_CU remains 30 meters, but 30m in WGS 1984 World Mercator is a much smaller distance on the ground, 21 meters. So, raster projection using the ‘convert units’ method has unnecessarily increased the resolution of the output raster. If we were projecting in the opposite direction (starting from WGS 1984 World Mercator), then we would have lost a significant amount of raster data. When the same raster is projected using the ‘preserve resolution’ method, its cell size becomes 42 meters and the geodesic ground distance remains 30 meters, which is the same as the geodesic distance of the input raster.

Example 2:

In this example, we will project from a UTM zone to its adjacent zone, which can happen when mosaicking together many different DEMs for a larger (state sized) area. In figure 4, let’s take a raster (R_input2) in WGS 1984 UTM Zone 11N and project it to its adjacent zone WGS 1984 UTM Zone 12N, creating output (R_out_CU2) and (R_out_PR2) for ‘convert units’ and ‘preserve resolution’ respectively. From here we will again compare the geodesic distance between the cell centers to determine which method preserve the geodesic distance more accurately.


Figure 4: Cell boundaries of R_input2, cell centers of R_input2, R_out_CU2, R_out_PR2 and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input2 for comparison.

Figure 4: Cell boundaries of R_input2, cell centers of R_input2, R_out_CU2, R_out_PR2 and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input2 for comparison.


The cell size for the input raster, R_input2 is 30 meters, which is approximately the same as the geodesic ground distance in this area. When the raster is projected using the ‘convert units’ method, the cell size of the output raster, R_out_CU2 becomes 30 meters and the geodesic ground distance becomes approximately 31 meters. When the same raster is projected using the ‘preserve resolution’ method, its cell size becomes 28.99 meters, and the geodesic ground distance is 30 meters, which is the same as the input raster.

In both the examples, the ‘preserve resolution’ method seems to preserve the geodesic ground distance between cell centers better than the ‘convert units’ method. Other combinations of input and output spatial references may, of course, show difference between the methods, but overall it is safe to say that the ‘preserve resolution’ Method is a better approach for preserving geodesic distance while projecting datasets.

An important property of the ‘preserve resolution’ method is that the output cell size depends on the location of the dataset. The same combination of input and output spatial reference will yield a different output cell size if the input raster dataset is at a different geographic location. If you need to use one cell size for different raster datasets (for example, processing adjacent DEM tiles), specify one raster dataset to use as the cell size source while performing raster analysis for the tiles.

Next time you use a Spatial Analyst geoprocessing tool or python command to:

  • create an output with a spatial reference different from that of the input dataset,
  • use input datasets with different spatial references,
  • specify an analysis cell size using a dataset with a different spatial reference,

pay attention to the output cell size and consider using either the preserve resolution or center of extent methods. By default, the projection method will do the ‘convert units’, which existed in previous versions of ArcGIS, but as we have seen, this method may unnecessarily increase or decrease the resolution of your valuable raster data.

Additional resources

Handling projections during analysis in Spatial Analyst

How the analysis window is determined in Spatial Analyst


This blog post has been prepared by James TenBrink, senior software engineer in the raster analysis group at Esri, and Sarmistha Chatterjee.

Original post:

As you will have heard, ArcGIS Pro 2.2, ArcGIS Desktop 10.6.1, and ArcGIS Enterprise 10.6.1are now available for download!  If you use the Spatial Analyst extension, or do Raster Analysis in general, read on for more information about the new capabilities on offer.


Where do I get it, and what’s changed?

 You can download and install the software right now from the following links: ArcGIS Pro 2.2, ArcGIS Desktop 10.6.1, ArcGIS Enterprise.  For a quick summary of all the changes that have been made for these releases, have a look at their respective What’s New topics:

                     - What’s New in ArcGIS Pro

                     - What’s New in ArcMap 10.6.1

                     - What’s New in ArcGIS Enterprise Portal

Here are the main categories of the changes.

                     1. New and updated tools for the Spatial Analyst extension in ArcGIS Pro and ArcMap.

                     2. Enhanced performance potential for Spatial Analyst tools with Parallel Processing.

                     3. New Raster Functions are available.

                     4. New capabilities are available for Raster Analysis through a Portal in ArcGIS Pro.

                     5. New capabilities are available for Raster Analysis through a Map Viewer with ArcGIS Enterprise.

                     6. If you perform Raster Analysis through the REST API, a new task was added.

Following that, some background information on how to configure and perform raster analysis with ArcGIS Enterprise is listed.


1. Spatial Analyst extension

For the Spatial Analyst extension product, there some changes to environment behavior, some tools have received new parameters, and more tools have been enabled for parallel processing.

Interactive Python Window

Spatial Analyst tools can use a new ArcPy environment,   arcpy.env.buildStatsAndRATForTempRaster, that can be set to true in the interactive Python window in the application to improve the display of the raster output. This property is accessible and can be set in a standalone python scripts, but will have no effect as the output is not displayed.

It is a Boolean environment that specifies whether or not to calculate statistics and build a raster attribute table for a temporary raster created from an interactive Python session while adding it to the map. It is True by default for all Spatial Analyst tools. When set to False, the statistics will be approximate for the purpose of symbolizing output raster layers, and no raster attribute table will be built.

Distance toolset

The Euclidean distance tools have a new parameter option, distance_method.  With the Geodesic option, the distances are calculated on the ellipsoid, which means that the results of the operation do not change regardless of the input or output projection.  The default Planar option will return the same result as in previous releases. The tools are: Euclidean Allocation (Pro | ArcMap), Euclidean Direction (Pro | ArcMap), and Euclidean Distance (Pro | ArcMap).

An improvement was made to the default behavior for a number of the Cost and Path distance tools.  The processing extent and spatial reference now default to that of the input cost raster.  This will improve the accuracy of the results, and better meets the expected behavior. What’s the reason behind this change?  Previously, the processing extent defaulted to the input source dataset, and since that is often smaller than that of the cost surface extent, the resulting cost paths were limited.  Now, the tools will return the true least-cost path between locations within the full extent of the cost surface.  The full list of the seven affected tools is: Cost Allocation (Pro | ArcMap), Cost Back Link (Pro | ArcMap), Cost Connectivity (Pro | ArcMap), Cost Distance (Pro | ArcMap), Path Distance (Pro | ArcMap), Path Distance Allocation (Pro | ArcMap), Path Distance Back Link (Pro | ArcMap).

Extraction toolset

For the Extract By Mask  (Pro | ArcMap) tool, the input raster will now be used as the default snap raster.  This improves the accuracy of the output by ensuring the correct alignment of the feature mask with the value raster. If both the input raster and the input mask are raster, by default the tool will use the input with the largest cells size as the cell size for the operation.  If the input mask is a feature, by default the input raster will define the cell size and snap raster environment for the operation.

Hydrology toolset

The Flow Accumulation (Pro | ArcMap) and Flow Distance (Pro | ArcMap) tools have a new optional parameter that allows you to specify which option was used to create the particular flow direction raster you are using as input for the tool.  The flow_direction_type raster parameter has the choices of D8 (the default method, which assigns the flow direction to the steepest downslope neighbor), MFD (this method assigns multiple flow directions towards all downslope neighbor), and DINF (this uses the D-Infinity flow method to assign flow direction based on the steepest slope of a triangular facet).

Segmentation and Classification toolset

The Export Training Data For Deep Learning (Pro | ArcMap) tool has a new optional parameter, start_index. This is useful when appending image chips to an existing sequence for training the deep learning classifier.

Surface toolset

The Contour (Pro | ArcMap) tool has two new parameters.  With contour_type, you can now choose to create contour output as polygons instead of just polylines.  There are several types of filled contours to choose from.  When contouring larger or complicated surfaces with polygons, you can use the max_vertices_per_feature parameter to control the maximum number of vertices per polygon feature.

Zonal toolset

For zonal tools that perform a zonal operation on an input value raster, that raster will be used as the default snap raster for the operation.  The benefit here is improved accuracy for the output due to the correct alignment of the feature zone with the value raster. The tools with this new default behavior are Zonal Histogram (Pro | ArcMap), Zonal Statistics (Pro | ArcMap), and Zonal Statistics as Table (Pro | ArcMap).

The Tabulate Area (Pro | ArcMap) tool has a new default behavior as well.  Now, when both the zone input and the class input are raster, the class raster will be used as the snap raster for the operation.  If one of these inputs is a raster and the other a feature, the one that is raster will be used for setting both the processing cell size and the snap raster.


2. Parallel Processing

As promised, the parallel processing capability that was added to a number of tools at ArcGIS 10.6 but not Pro 2.1 is now available for those tools in Pro 2.2!  We also enabled this capability for a few more tools for ArcGIS 10.6.1.


ArcGIS Pro 2.2

Distance toolset: Cost Allocation (Pro), Cost Back Link (Pro), Cost Distance (Pro), Euclidean Allocation (Pro), Euclidean Direction (Pro), Euclidean Distance (Pro), Path Distance (Pro), Path Distance Allocation (Pro), and Path Distance Back Link(Pro).

Generalization toolsetNibble (Pro)

Hydrology toolsetFill (Pro), Flow Accumulation (Pro), Flow Direction (Pro), Flow Distance (Pro), Sink (Pro), Stream Link (Pro), and Watershed (Pro).


ArcMap 10.6.1

Distance toolsetCost Back Link (ArcMap), Euclidean Direction (ArcMap), Path Distance (ArcMap), Path Distance Allocation (ArcMap), and Path Distance Back Link (ArcMap).


3. Raster Functions

Have you  been using Raster Functions to perform select raster operations on pixels displayed in your ArcGIS Pro map window?  There is a large number of operations you can use on your raster or imagery data out-of-the box, with more available when you have a Spatial Analyst or an Image Analyst extension license available.

Three new distance raster functions are available in Pro 2.2, Cost Back Link, Cost Path, and Euclidean Direction.

In addition, the Flow Accumulation and Flow Distance functions have the new flow direction type parameter.


Following is the current list of Raster functions you can use that require either a Spatial Analyst (SA) or an Image Analyst (IA) license in ArcGIS Pro. Which specific license(s) are required are identified.

Analysis Functions: Kernel Density (SA), Weighted Overlay (SA), Weighted Sum (SA, IA)

Classification Functions: Classify (SA, IA), ML Classify (SA, IA), Segment Mean Shift (SA, IA)

Data Management Functions: Nibble (SA)

Distance Functions : Cost Allocation, Cost Back Link, Cost Distance, Cost Path, Euclidean Allocation, Euclidean Direction, Euclidean Distance, Least Cost Path (All require SA)

Hydrology Functions: Fill, Flow Accumulation, Flow Direction, Flow Distance, Stream Link, Watershed. (All require SA)

Math : Abs, Divide, Exp, Exp10,  Exp2, Float, Int, Ln, Log10, Log2, Minus, Mod, Plus, Power, Round Down, Round Up, Square, Square Root, Times (All require either SA or IA)

Math : Conditional : Con (SA, IA), Set Null (SA, IA)

Math : Logical : Bitwise And, Bitwise Left Shift, Bitwise Not, Bitwise Or, Bitwise Right Shift, Bitwise XOr, Boolean And, Boolean Not, Boolean Or, Boolean XOr, Equal To, Greater Than, Greater Than Equal, Is Null, Less Than, Less Than Equal, Not Equal (All require either SA or IA)

Math : Trigonometric: ACos, ACosH, ASin, ASinH, ATan, ATan2, ATanH, Cos, CosH, Sin, SinH, Tan, TanH (All require SA or IA)

Statistical Functions: Cell Statistics (SA or IA), Zonal Statistics (SA or IA).

Surface Functions: Viewshed (SA).  Note, there are other surface functions, such as Aspect, Hillshade or Slope, that you can use without an Spatial Analyst or Image Analyst license.


4. Raster Analysis Tools in ArcGIS Pro

In ArcGIS Pro 2.2, one new Raster Analysis tool has been added, and two other tools have new parameter options.

Hydrology toolset

The Flow Accumulation and Flow Distance tools have a new parameter that allows you to specify the type of the input flow direction raster: D8, Multi Flow Direction (MFD), or D-Infinity (DINF).

Use Proximity toolset

The new Determine Travel Cost Path As Polyline tool is used to calculate the least cost path between sources and destinations.


Follow this link to see the full suite of functionality available in the Raster Analysis toolbox in ArcGIS Pro.


5. Raster Analysis in the Map Viewer

Some new tools are available for performing raster analysis in the Map Viewer when you are connected to an updated version of the Portal for ArcGIS in ArcGIS Enterprise.

There is a new toolset for proximity (distance) analysis, with the following three tools:

  • Calculate Distance
  • Determine Optimum Travel Cost Network
  • Determine Travel Cost Path As Polyline

In the Analyze Terrain toolset, there is a new Watershed tool.

New Map Viewer tools for Raster Analysis

Four new Map Viewer tools for Raster Analysis are available in this release

6. Raster Analysis in the REST API

The Determine Travel Cost Path as Polyline task was added to the ArcGIS REST API for 10.6.1.  This task can be used to calculate the least cost way to travel from the source location to a destination.


See Get started with the Raster Analysis service to learn more about using the REST API to execute other Raster Analysis service tasks, and how to configure your portal to enable the functionality.


Some background on raster analytics in ArcGIS Enterprise

Raster Analytics using ArcGIS Enterprise is a flexible raster processing, storage, and sharing system that employs distributed computing and storage technology based on ArcGIS Image Server.  The source data and processed results are stored, published, and shared across your enterprise as image and feature web layers,  according to your needs and priorities.

This capability can be further extended by leveraging cloud computing capabilities and resources. The net result is that raster processing and analysis on very large datasets, which heretofore were difficult to perform in a timely manner on single machines, can now be executed in short order by harnessing the compute power of multiple servers to simultaneously attack the tasks you give them.

In order to have access to Raster Analytics, you need to have an ArcGIS Enterprise deployment available.  After ArcGIS Server is installed, ArcGIS Image Server will also need to be installed and enabled.   Please see the following resources for more details on configuring and using these services for performing raster analysis.






Above we’ve covered the important changes and improvements for raster analysis that have been introduced to the platform in ArcGIS Pro 2.2, ArcGIS Desktop 10.6.1, and ArcGIS Enterprise 10.6.1.  After you have downloaded the new versions, please give the new capabilities a try.  If you encounter any difficulties along the way, be sure to communicate them back to us through the Support channels or GeoNet, so we can work on resolving them.

When working with Zonal tools in the Spatial Analyst toolbox, have you occasionally gotten results that that you didn’t quite expect? Here we’ll cover a few scenarios where and why you might have run into some issues, how to work around them, and how things have changed in the latest release to avoid them in the first place. The Zonal Statistics tool calculates statistics on values of a raster within the zones defined by another dataset. To learn more, read How Zonal Statistics works.

The zone input can either be a feature or a raster. If the zones are defined by features, an internal feature to raster conversion will occur. The internal conversion for a polygon zone uses the cell center method to rasterize the input. With an analysis extent calculation method of intersection-of or union-of, the origin of the internal raster may be determined entirely by the feature class. Snapping is then performed relative to that origin: the internal raster origins at the lower-left corner of the analysis extent and its upper-right corner is adjusted by the cell size. The cells of the internal zone raster and the value raster may not align, which will trigger a resampling during the zonal operation. Resampling will also occur if the input zone is a raster with different cell size and/or alignment. Often times, we end up getting an unexpected result due to the feature to raster internal conversion or misalignment of the zone and value raster. Let’s look at some of these scenarios in detail:


1. Unexpected statistics values

The common source of unexpected statistics values is the misalignment of the cells of the zone and value rasters.

In this example in figure 1a below, you may expect the Zonal Statistics tool to compute the statistics based on the cells of the value raster whose cell center falls within the feature zone, which are values 79, 81 and 27. However, due to the way the default internal conversion will be performed based on the origin and extent, how the feature zone gets rasterized will create an unexpected output. As you can see in figure 1b the rasterization grid used for the internal conversion does not align with the value raster. Therefore, using the cell center method, the zone raster will end up analyzing a different set of cells from the value raster (see figure 1c) than you originally anticipated from figure 1a.

Figure 1: Internal conversion of feature zone without considering the value raster for cell alignment.

Figure 1: Internal conversion of feature zone without considering the value raster for cell alignment.


To avoid this issue, there is a step you can take to ensure that the feature zone being converted to a raster is aligned with the value raster. Simply set the snap raster to the value raster from the tool environment. The misalignment can also occur when the input zone is a raster, if the cell size and/or cell alignment does not align with the value raster. You can set the snap raster environment to the value raster to get the expected output.

Let’s look in the example below, in figure 2b, to understand how setting the snap raster to the value raster ensures the rasterization grid used for the internal conversion aligns with the value raster in figure 2b. As a result, the zone raster will analyze those cells from the value raster (see figure 2c) that you originally anticipated from figure 2a.

Figure 2: Internal conversion of feature zone considering the value raster for cell alignment.


The good news is that ArcGIS Pro 2.2 and ArcMap 10.6.1 use the value raster as the snap raster by default for internal conversion of the feature zones. If you are using a version prior to ArcGIS Pro 2.2 or ArcMap 10.6.1, specify the value raster as the snap raster in the environment.


2. Missing zones in the output

The most frequent cause of missing zones in the output occurs when the cell center of the rasterization grid does not fall within the feature zone. This can occur for zones that are smaller than the area of a cell of the internal zone raster or even for larger zones.

In the example below, let’s look at how rasterization occurs for zones of different size and location. Figure 3a has three zones, where, zone1 is larger than a cell, and zone2 and zone3 are smaller than a cell, and the cell center falls outside zone2 and within zone3. During the zone rasterization process in figure 3b, it so happens that no cell centers fall within zone1 and zone2, and only zone3 contains a cell center. Therefore, only zone3 will be rasterized and the other two zones will essentially disappear, as shown in figure 3c.

Figure 3: Internal conversion of feature zone leading to missing zones.

Figure 3: Internal conversion of feature zone leading to missing zones.


To avoid this, ensure that each of your zones contains one or more cell centers. You can create more cell centers by specifying a smaller cell size in the environment. The default analysis cell size comes from the value raster. Therefore, specifying a cell size that is smaller than that of the value raster will enable more zones to be captured.

For figure 4, let’s repeat the same example from figure 3 to see how changing cell size better captures all the zones. Similar to figure 3a, figure 4a also has three zones, where, zone1 is larger than a cell, and zone2 and zone3 are smaller than a cell but are spatially located differently. Figure 4b shows a finer rasterization grid based on a cell size that is four times smaller than the default cell size. During the zone rasterization process, multiple cell centers now fall within each of the zones. As a result, all the zones get rasterized as shown in figure 4c.

Keep in mind that specifying a smaller cell size, will generate a larger output raster.  In this example, the output raster will be sixteen times larger than the raster with default cell size. Even more important, the higher resolution output may give the wrong perception of a higher quality result than what it actually is, since the additional detail does not actually exist in the input value raster.

Figure 4: Internal conversion of feature zone with a smaller cell size capturing all zones.


Note: If you are using a version prior to ArcGIS Pro 2.2 or ArcMap 10.6.1, specify the value raster as the snap raster in the environment.


3. Other sources of unexpected result

You may also get unexpected results during the rasterization of feature zones if you have:

  • coincident points or multiple points on one cell
  • coincident polylines or multiple polylines passing through one cell
  • coincident polygons or partially overlapping polygons

Be sure to read the Zonal Statistics and How Zonal Statistics works help pages to learn more about how this tool works.



With the information presented here, you should be able to better understand how this tool operates, and how to guarantee better and more understandable results.  Keep in mind that there is a similar behavior in play for other Zonal tools, such as Tabulate Area, Zonal Histogram and Zonal Statistics as Table so you can employ the lessons learned here to achieve greater success with those tools, too. Keep in mind, that ArcGIS Pro 2.2 and ArcMap 10.6.1 now use the value raster as the snap raster by default for internal conversion of the feature zones. If you are using a version prior to ArcGIS Pro 2.2 or ArcMap 10.6.1, specify the value raster as the snap raster in the environment.

Let us know if you encounter other scenarios where you get an unexpected result while doing your analysis, or if you have any questions or comments. You can comment here or reach me at

ArcGIS Pro SDK for .Net allows you to extend the ArcGIS Pro user interface by creating custom add-ins leveraging different GIS functionalities. In this blog, we will take a look at how to execute Spatial Analyst tools in your add-in using the ArcGIS Pro SDK.

How to execute a geoprocessing tool

The ArcGIS.Desktop.Core.Geoprocessing namespace in the SDK provides a Geoprocessing class to help execute a geoprocessing tool. The Geoprocessing class within the namespace offers necessary methods to specify the input parameters, set up environment settings, and execute the geoprocessing tool. The static method, ExecuteToolAsync is used to execute the tool.
The first argument for ExecuteToolAsync is the geoprocessing tool name as a string. To specify a tool uniquely, the tool name must be appended with its toolbox alias. For example, the Copy Features tool is in the data management toolbox, and the alias of the data management toolbox is management. Therefore, to execute the Copy Features tool, the tool name should be specified as CopyFeatures_management. Without the toolbox alias, or with a misspelled toolbox alias, an error will be returned and the tool will not be executed because the geoprocessing framework is not able to find the tool.
The second argument for ExecuteToolAsync is the tool parameter values array, which holds all the input and output parameter values for the geoprocessing tool. Do not create the array yourself. Simply call the method MakeValueArray, to create it, passing in all input and output parameter values as arguments.
Additionally, you may want to specify an environment setting for the tool execution. The third argument for ExecuteToolAsync allows you to do that. Like the input/output parameters, the environment settings also need to be specified in an array. Again, no need to create the array by yourself, simply call the method MakeEnvironmentArray to make one.
The rest of the arguments for ExecuteToolAsync are optional. As an asynchronous method, ExecuteToolAsync will start the geoprocessing tool execution in a different thread other than the user interface (UI) thread, which allows the ArcGIS Pro UI to remain active while the tool executes.

How to execute a Spatial Analyst tool

Executing a Spatial Analyst tool is no different than any other geoprocessing tool. All we need to do is supply a tool name with an appropriate toolbox alias, which is sa. The following example will walk you through a C# example on how to execute the Zonal Statistics tool to calculate average elevation for each zone, using SDK.

Let’s start by specifying the tool input and output parameters:

// declaring tool parameter variables
string inZoneRas = @"c:\data\county.tif" ; // input zone raster
string zoneField = "Value"; // zone field
string inValueRas = @"c:\data\elevation.tif" ; // input valueraster
string outRaster = @"c:\output\outzs01.tif" ; // output raster
string statType = "MEAN" ; // statistics type
bool ignoreNoData = true ; // ignore NoData option

Now let’s create the first array with the above parameter values using the Geoprocessing.MakeValueArray method:

// create an array for the input parameter values
var valueArray = Geoprocessing.MakeValueArray(inZoneRas, zoneField, inValueRas, outRaster, statType, ignoreNoData);

Next, create another array for environment settings using Geoprocessing.MakeEnvironmentArray to set the cell size for analysis and to overwrite output if it exists:

// create an array for the environment settings
var envArray = Geoprocessing.MakeEnvironmentArray(overwriteoutput: true, cellSize: 30);

Finally, let’s execute the tool by calling the ExecuteToolAsync method, passing in the tool name, the tool parameter values array, and the environment settings array that we created above. Notice that the tool name ‘ZonalStatistics’ is appended with its toolbox alias ‘sa’, which refers to the Spatial Analyst toolbox:

// run ZonalStatistics
var gpresult1 = await Geoprocessing.ExecuteToolAsync("ZonalStatistics_sa", valueArray, envArray);

Because the Spatial Analyst is an extension product, a license is required in order to use its capabilities. However, we did not enable the license in the preceding code snippet as in our case, it is enabled through the ArcGIS Pro application. If the Spatial Analyst license is not already enabled, the tool execution will fail with a licensing error. To enable the Spatial Analyst license, configure your licensing options from the ArcGIS Pro application.

How to execute a map algebra expression

Now that we have learned how to execute a Spatial Analyst tool using the ArcGIS Pro SDK, let’s look at another example. In raster modeling, we often need to execute map algebra expression to solve a complex problem. In the Spatial Analyst toolbox, the tool that allows us to execute map algebra expression is called Raster Calculator.
In your add-in, you may take advantage of the Raster Calculator tool to execute single-line map algebra expressions. The Raster Calculator tool has two parameters only. The first parameter is the map algebra expression itself. The second parameter is the output raster, which saves the result of the calculation.
In the example below, let’s build a map algebra expression to find the land uses for areas with slope greater than 30 degrees and aspect less than 120 degrees, and use the Raster Calculator tool to execute it.

First, let’s specify the input raster datasets that will be used in our map algebra expression:

// input raster datasets for the map algebra expression
string inRas1 = @"c:\data\in_slope.tif" ;
string inRas2 = @"c:\data\in_aspect.tif" ;
string inRas3 = @"c:\data\in_landuse.tif" ;

Now, let’s build the map algebra expression. Notice that the input raster datasets are embedded in the expression itself, enclosed by single quotation marks:

// define the map algebra expression
string maExpression = String.Format("Con((‘{0}’ > 30) & (‘{1}’ < 120), ‘{2}’)",inRas1, inRas2, inRas3);

We need another variable to specify the output raster:

// define the output raster
string outRaster = @"c:\output\outrascal01.tif" ;

Now we can create an array using maExpression and outRaster:

// make the input parameter values array
var valueArray = Geoprocessing.MakeValueArray(maExpression, outRaster);

Finally, we kick off the Raster Calculator tool, which will execute the map algebra expression and save the result in outRaster:

// execute the Raster calculator tool to process the map algebra expression
var gpresult1 = await Geoprocessing.ExecuteToolAsync("RasterCalculator_sa", valueArray);


Now that you are comfortable executing Spatial Analyst tools and map algebra expressions, you can perform raster modeling in your add-ins. If you need more information, check out our help pages on ArcGIS Pro SDK and ArcGIS Pro Spatial Analyst.

The 2018 Esri User Conference (July 9-13) is almost here – are you ready?  We here on the Spatial Analyst team are busy practicing and polishing our presentations, and are looking forward to showing you what we’ve been working on since last summer.  If you do any kind of raster or imagery analysis, or do multidimensional analysis, please look at the guide below to help you plan out your time with us.

To help target your areas of interest, we’ve categorized things into several groupings. Each one will list out a general purpose of the grouping, followed by the specific session titles in chronological order.  Repeat presentations are also listed, in case you are not able to attend the first showing.

  1. Introduction to Raster Analysis
  2. Applied Raster Analysis
  3. Imagery
  4. Raster Analytics
  5. Python
  6. Multidimensional and Scientific data
  7. Road Ahead

See the full agenda for more details on these sessions, and more. Be sure to download the Esri Events Mobile App too!   (UC content coming soon)

Please come by the Island in the Showcase during the week (Tuesday and Wednesday from 9 – 6, and Thursday from  9 – 1:30).  We’d love to hear about the work you do, any difficulties you encounter, and any ideas you might have to make our software suit your needs even better.

Finally, remember to check out the Spatial Analysis : The Road Ahead session for a peek into the future.


1. Introduction to Raster Analysis with Spatial Analyst

The ArcGIS Spatial Analyst extension offers a large number of spatial modeling and analysis tools.  The following sessions cover many aspects of this product.  The introductory sessions demonstrate the wide range of capabilities on offer.  The Map Algebra session introduces the simple and powerful language that Spatial Analyst uses for performing a wide range of raster and feature geographic analysis. Following that are more focused sessions on specific aspects of the capabilities, such as suitability modeling, cost distance modeling, and interpolating surfaces from vector data.

Spatial Analyst: An Introduction

Tue, July 108:30 am – 9:30 amTech WorkshopSDCC – Room 29 D
Tue, July 104:00 pm – 5:00 pmTech WorkshopSDCC – Room 29 D

Map Algebra: Getting Started  

Tue, July 1010:00 am – 10:45 amDemoDemo Theater 10

Finding the Best Locations Using Suitability Modeling 

Tue, July 102:30 pm – 3:30 pmTech WorkshopSDCC – Room 30 D
Wed, July 111:00 pm – 2:00 pmTech WorkshopSDCC – Room 29 D

Cost Distance Analysis: Identifying the Best Path

Wed, July 118:30 am – 9:30 amTech WorkshopSDCC – Room 29 C
Thu, July 12  4:00 pm –   5:00 pmTech WorkshopSDCC – Room 29 C

Interpolating Surfaces in ArcGIS

Wed, July 1110:00 am – 11:00 amTech WorkshopSDCC – Room 30 C
Thu, July 124:00 pm – 5:00 pmTech WorkshopSDCC – Room 31 A

Surface Interpolation in ArcGIS

Wed, July 1111:15 am – 12:00 pmDemoDemo Theater 10


2. Applied Analysis

If you are interested in learning more about applied raster analysis capabilities offered by ArcGIS, the following sessions will be of interest to you.  Hydrological modelling is one of the specific applications for which raster-based processing is most highly suited.  Attend these sessions to learn more about creating hydro-conditioned surfaces, watershed delineation, stream flow calculation, flood modeling, and flood impact assessment.  Also included in this group is a session on applied suitability modelling, in particular, the workflow used to identify the best habitat patches for bobcat, and how to connect them with the optimum network of wildlife corridors

HydroGIS 2018 – Forecasting and Response for Flows and Floods

Sun, July 88:30 am – 5:00 pmFree preconference WorkshopSDCC – Room 29 D

 Creating a Hydro Conditioned DEM

Wed, July 118:30 am – 9:30 amTech WorkshopSDCC – Room 30 A
Wed, July 114:00 pm – 5:00 pmTech WorkshopSDCC – Room 30 A

Hydrologic and Hydraulic Modeling in ArcGIS

Wed, July 1110:00 am – 11:00 amTech WorkshopSDCC – Room 29 D
Thu, July 124:00 pm – 5:00 pmTech WorkshopSDCC – Room 30 A

GIS Techniques for Floodplain Delineation

Wed, July 111:15 pm – 02:00 pmDemoDemo Theater 10

 Bobcat Suitability Modeling 

Thu, July 1212:15 pm – 1:00 pmDemoDemo Theater 10


3. Raster Analytics with Image Server

The ArcGIS Enterprise Image Server can be used for quickly processing very large collections of raster and imagery data. The following sessions will introduce the capabilities of this product, describe the architecture, detail the deployment options, and identify the performance benefits offered by distributed processing.

ArcGIS Enterprise: Raster Analytics in Image Server

Wed, July 1110:00 am – 11:00 amTech WorkshopSDCC – Room 01 A/B
Thu, July 1210:00 am – 11:00 amTech WorkshopSDCC – Ballroom 06 F

ArcGIS Enterprise: Building Raster Analytics Workflows

Wed, July 11 1:00 pm – 2:00 pmTech WorkshopSDCC – Room 31 A

ArcGIS Enterprise: Deploying Distributed Raster Analytics

Thu, July 12 1:00 pm – 2:00 pmTech WorkshopSDCC – Room 30 E


4. Imagery and Image Analyst

Whether your data comes from satellite imagery, aerial imagery, or drones, ArcGIS provides extensive capabilities for imagery management, visualization and analysis.  See the following list of sessions if you want to find out more about imagery collection, processing, display, classification, interpretation and information extraction.

Advanced Raster Analytics

Sun, July 82:15 pm – 3:00 pmImagery SummitMarriott – Grand Ballroom 5
Sun, July 84:15 am – 5:00 pmImagery SummitMarriott – Grand Ballroom 5

Imagery in ArcGIS: What’s New 

Tue, July 108:30 am – 9:30 amTech WorkshopSDCC – Rm 07 A/B
Thu, July 122:30 pm – 3:20 pmTech WorkshopSDCC – Rm 32 A/B

 ArcGIS Pro: Introduction to Image Analyst Extension

Tue, July 1010:00 am – 11:00 amTech WorkshopSDCC – Room 03
Tue, July 104:00 pm – 5:00 pmTech WorkshopSDCC – Ballroom 06 F

ArcGIS Pro: Image Segmentation, Classification, and Machine Learning

Tue, July 10 1:00 pm – 2:00 pmTech WorkshopSDCC – Room 17 B
Thu, July 12 1:00 pm – 2:00 pmTech WorkshopSDCC – Room 15 A

Image Analysis and Visualization using the Web Map Viewer

Tue, July 101:15 pm – 2:00 pmDemoDemo Theater 01

ArcGIS Enterprise: Managing and Serving Imagery in the Cloud Using ArcGIS Image Server

Tue, July 10 2:30 pm – 3:30 pmTech WorkshopSDCC – Room 04
Thu, July 12 10:00 am – 11:00 amTech WorkshopSDCC – Room 02

How Raster Functions Revolutionized the World Population Estimate

Wed, July 1110:00 am – 10:45 amDemoDemo Theater 11

Image Processing using Raster Functions    (Intermediate)

Wed, July 112:30 pm – 3:15 pmDemoDemo Theater 01


5. Raster and Image Analysis with Python

Python offers a powerful way to perform raster and image analysis in ArcGIS.  The integration of Map Algebra with Python via the Spatial Analyst ArcPy module offers a broad range of capabilities for raster analysis and automation of geoprocessing workflows. If you like NumPy, we’ve got that covered too!

With the raster module of the ArcGIS API for Python, you can derive information from raster imagery with the large number of available raster functions. As the datasets continue to get larger and larger, learn about how parallel processing, distributed processing and the ArcGIS Image Server can be used to optimize performance.

Python: Raster Analysis

Tue, July 101:00 pm – 2:00 pmTech WorkshopSDCC – Room 31 C
Thu, July 122:30 pm – 3:30 pmTech WorkshopSDCC – Room 03

ArcGIS API for Python: Image Analysis 

Thu, July 1210:00am – 11:00 amTech WorkshopSDCC – Room 16 A


6. Scientific and Multidimensional data

Scientific and multidimensional data is a burgeoning area of growth in GIS.  The ArcGIS platform has great capabilities for supporting the import, management, visualization, analysis and sharing of this type of information.  If you would like to use netCDF, HDF or GRID data for global scale spatial and temporal analysis, the following sessions will be of interest to you.

Scientific Tools for Atmospheric and Climate Analysis

Sun, July 088:30 am – 5:00 pmPreconferenceSDCC – Room 30 D

Working with Scientific Data in ArcGIS

Tue, July 101:00 pm – 1:20 pmShowcaseSDCC – Interoperability and Standards Spotlight Theater

Scientific and Multidimensional Raster Support in ArcGIS

Wed, July 118:30am – 9:30amTech WorkshopSDCC – Room 31 B

Analyzing Multidimensional Scientific Data in ArcGIS 

Wed, July 111:00 pm – 2:00 pmTech WorkshopSDCC – Room 30 E


7. The Road Ahead

Come join us for this Road Ahead session to find out what enhancements have been made in ArcGIS Spatial Analysis and what we are planning for the upcoming year, especially in the areas of machine learning, big data, real time analysis, and integrating spatial analysis with the scientific Python ecosystem.

Spatial Analysis: The Road Ahead

Wed, July 111:00 pm – 2:00 pmTech WorkshopSDCC – Ballroom 06 B
Fri, July 13  9:00 am –  10:00 amTech WorkshopSDCC – Room 05 A

With growing raster dataset sizes, the processing times for analysis are becoming longer and longer. By employing concepts from parallel and distributed computing, we can improve performance and scalability of workflows with Spatial Analyst tools. For some tools, Spatial Analyst offers enhanced performance with built-in parallel processing capability. These tools use the multi-core processors on modern computing hardware to complete processing tasks more quickly. Additionally, the ArcGIS Image Server provides capabilities for scalable distributed raster analysis and distributed storage of large image and raster collections. However, built-in capabilities are not yet available across all Spatial Analyst tools. In this blog, we will identify scenarios where the multiprocessing Python module ( can be used to optimize performance of raster analysis workflows by dividing up the work between multiple processes on a given machine. We will identify candidate raster operations that benefit most from parallel computation and learn how to develop efficient parallel systems for raster geoprocessing within the robust Python environment.


Candidate raster operations for parallelization can be broadly classified into three geoprocessing scenarios. Parallelism is invoked using a different mechanism for each scenario.
 Processing a large raster dataset with a single analysis tool
 Batch processing a collection of raster datasets by running a single analysis tool multiple times
• Raster geoprocessing workflow by running suitable analysis tools chained together


From our in-house testing, we evaluated the performance of a local operation executed parallelly on a large sample dataset. The graph below summarizes the performance improvements that were observed.


The advantages of optimizing raster analysis tasks with Python multiprocessing are evident from this graph. We can see significant improvements while adding more processes to help with the analysis, especially going from one to four processes. Beyond that, gains were negligible due to the overhead of spawning multiple processes.


Processing a large raster dataset

The increase in resolution of raster datasets has led to larger and larger data sizes. Currently, datasets are on the order of gigabytes and increasing, with billions of raster cells. While computing power of the processors and size of the memory in computers have increased appreciably, legacy equipment and algorithms suited to manipulating small rasters with coarser resolution make processing these improved data sources costly. [1]


Data decomposition, also known as divide and conquer, is a popular strategy used in parallel computing that we will take advantage of to parallelly process a large raster dataset. The algorithms used in raster analysis tools can be broadly classified into four categories – local, focal, zonal and global operations. For a deeper dive into the types of cell-based raster operations, read this article. Local, focal and zonal raster operations are simple to program with when it comes to data decomposition. Once the data is decomposed appropriately, each data ‘chunk’ can be operated on independently on by a process without the need to communicate with other processes. However, global raster operations are tougher to integrate with data decomposition and require communication between processes. Let us look at an example of processing a large raster dataset using a local math raster operation, Square Root. The Local, or per-cell operations, are the simplest to parallelize using a ‘divide and conquer’ strategy, since the resulting value at each cell only depends on the input value at that cell location. For each cell, the Square Root tool calculates the square root of the value from that cell. Using the tool serially would mean simply running the Square Root tool on the entire large dataset, but, this process can be time consuming.


Default, non-optimized serial approach to processing a large raster


Instead, through data decomposition, we can redesign the analysis task to utilize multiple worker processes simultaneously, thus improving the performance of the overall analysis. The graphic below depicts splitting the domain of a large raster into several smaller chunks, and using multiple worker processes to simultaneously perform analysis on each of the sub-sections. The results are then stitched back together for the final output.


Multiprocessing large rasters parallelly


A sample script is shared on GitHub here that goes in depth on how this problem can be solved programmatically using ArcGIS Desktop and the Python multiprocessing module.


Batch processing a collection of raster datasets

When it comes to batch processing many datasets through a raster analysis tool, the common approach would be to use an iterator in ModelBuilder or write a Python script with a loop to iterate over each dataset in the batch and process them serially. This method can be time consuming when working with a large collection of rasters, particularly when running analysis tasks that have significant compute times.


Default sequential approach to processing a multiple rasters


Parallelism is a straightforward mechanism for batch processing when the analysis of each dataset in the batch can be performed independently from the rest. From the graphic below we can see how multiple processes working simultaneously enable faster processing of the batch queue.


Using multiprocessing to efficiently process multiple rasters in a parallel fashion


A sample script is shared on GitHub here that describes in detail how batch processing can be solved programmatically using ArcGIS Desktop and the Python multiprocessing module.


Raster geoprocessing workflows

A geoprocessing workflow is a multiple-step procedure that combines geoprocessing tools and geographic data to produce a meaningful result. Within ArcGIS, raster geoprocessing workflows can be written as models using ModelBuilder or as Python scripts. The standard approach in either cases is to chain together the tools needed to perform your analysis and execute them serially. Let us look at an example workflow that assesses a suitability raster by running the Slope, Aspect, Reclassify and Weighted Sum tools. These tools are available as part of the Spatial Analyst Extension in ArcGIS Desktop.


Default approach to performing a workflow


In the above example, as tools are executed in a serial fashion, only one worker process can be utilized at a time to complete the workflow. To parallelize any geoprocessing workflow, the first task is to decompose the problem and identify parts of it that may be handled independently. This workflow is a good candidate for parallel processing as the execution of Slope, Aspect and Reclassify tools are independent tasks. These tasks have no dependencies on the execution of other tools in the workflow. However, the Weighted Sum tool is a dependent task, having dependencies on the outputs from the Slope, Aspect and Reclassify tools. Until the Slope, Aspect and Reclassify tools have finished executing, the Weighted Sum tool cannot begin its analysis. Having identified the independent and dependent tasks within this workflow, we can redesign this problem to parallelize it.


Incorporating parallel processing into model workflows


In this redesigned workflow, we are making use of multiple worker processes to execute independent tasks simultaneously, rather than depend on a single worker to process each task serially.

Best practices and considerations

There are many factors to consider while combining the capabilities of the arcpy and multiprocessing modules to improve performance of raster geoprocessing tasks.


• There are always overheads associated with spawning multiple processes that must be accounted for when considering a parallelized approach. In situations where the processing task is complex, and the processing data is large or the batch size is huge, parallelism can provide performance benefits that outweigh the overhead. In other situations, such as when the processing task is very simple, or if the processing datasets were not particularly large, it may be that utilizing multiprocessing does not provide any significant performance benefit and, in some cases, slows down overall processing speed. As parallelizing your code can be tedious, you should consider the end goal and opportunity cost of investing time in parallelization. For a task that is run repetitively, say on a scheduled basis, and in big data processing, parallelization can be advantageous.


• Avoid writing output rasters from multiple processes to a common File Geodatabase (FGDB) or to multiple Esri Grid rasters within a common folder workspace. These output formats often experience schema locks or synchronization issues when accessed by multiple simultaneous processes.


• You are encouraged to use ArcGIS Pro, ArcGIS Server or ArcMap with ArcGIS for Desktop Background Geoprocessing (64-bit) for parallelized raster analysis. Using 64-bit processing to perform analysis on systems with large amounts of RAM may help with processing large data efficiently.

Looking Ahead

The Spatial Analyst development team continues to work on parallelizing and distributing additional tools to further improve performance and scalability. Be on the lookout for these enhancements with future releases of ArcGIS Desktop, ArcGIS Pro and ArcGIS Image Server!


[1] Barnes, Lehman, Mulla. “Priority-Flood: An Optimal Depression-Filling and Watershed-Labeling Algorithm for Digital Elevation Models”. Computers & Geosciences. Vol 62, Jan 2014, pp 117-127, doi: ”10.1016/j.cageo.2013.04.024”.

For the Spline with Barriers interpolation tool, the enhancements that were made when the tool was implemented in ArcGIS Pro 2.0 are now also available in ArcGIS 10.6. Let’s have a look at the history of this tool, and some example applications.

Tool History

The Spline with Barriers tool was first implemented in ArcGIS more than ten years ago.  It was included in the Spatial Analyst and 3D Analyst toolboxes initially as a script tool which called a Java library that performed the interpolation.  The tool was not included in the initial release of ArcGIS Pro.  However, for ArcGIS Pro 2.0 the tool was rewritten in C++ with some optimizations and bug fixes. This improved C++ implementation is now also available in ArcGIS 10.6, and has replaced the older Java implementation.


Often we have a variable that is spatially not continuous and we want to use interpolation to produce an output raster that has values everywhere. For example, soil characteristics, or water quality in a braided meandering stream. In these cases you can use Spline with Barriers and specify either a polygon or polyline feature class to define the boundary of the discontinuity.

Methods and comparisons

Spatial Analyst and 3D Analyst have two interpolation methods that have an optional barrier input, those being IDW and Spline with Barriers.

The main difference between IDW and Spline with Barriers, other than the algorithm, is the way in which the points that are to be used in the interpolation are defined. IDW uses a “line of sight” approach, which means that if a point can’t be “seen” because of a barrier, then it is not used to make the prediction at that particular location. Spline with Barriers, on the other hand, weights the points based on the shortest distance around a barrier. In the illustration below, IDW (on the left) will only use 3 points to make a prediction when a barrier intervenes. In contrast, Spline with Barriers will utilize all 4 points to make the prediction.

Figure 1: Searching neighborhood for IDW (left) and Spline with Barriers (right) when using a barrier.

Figure 1: Searching neighborhood for IDW (left) and Spline with Barriers (right) when using a barrier.

Case Study

As an example, we’ll use the same case study described in Creating Faulted Geologic Surfaces with ArcGIS by Mike Price in the ArcUser Summer 2014 issue. In this article, the Spline with Barriers tool (the original Java version) is used.

We’ll use the point feature class, which contains the depth to the top of the Mississippian Leadville Limestone, and a polyline feature class defining the subsurface faults, to create an output depth raster with a cell size of 5 meters.

Figure 2: The geoprocessing tool dialog is on the left. To the right is the output depth raster, with the input points and barrier layers displayed on top.

Figure 2: The geoprocessing tool dialog is on the left. To the right is the output depth raster, with the input points and barrier layers displayed on top.

Figure 3: The output depth raster displayed in a 3D perspective view.  Note the steps created by the barriers.

Figure 3: The output depth raster displayed in a 3D perspective view. Note the steps created by the barriers.

We often rely on contour lines to aid our interpretation of an interpolated surface. However, in the vicinity of fault lines there may be abrupt changes in the depth values between some adjacent raster cells.  As a result, we cannot use the standard Contour tool as it will incorrectly produce many contours in these areas. The Contour with Barrierstool is well suited for this type of data as illustrated in the images above.


This exercise shows how to model the elevation of the top of the Mississippian limestone in Lisbon Valley, Utah, using only formation top elevations and fault barriers to generate a reliable predictive elevation surface.

When using a geoprocessing tool, for example Hillshade, when you specify an extent in the environment settings, you might have noticed sometimes that your output raster is slightly larger than your specified extent. Ever wondered what is going on inside the box? Let’s find out what triggers that effect.

The Extent environment controls where the raster analysis occurs, which means that the tools that honor this environment will only process the raster cells that fall within the extent. When you specify an extent in the environment, the lower-left corner of the specified extent will automatically become the lower-left corner of the output raster, unless you have also specified a Snap Raster environment. From here, the upper-right corner of the output raster is adjusted in such a way that the specified extent falls within your output raster. Whether the upper-right corner will be adjusted or not is determined by the output cell size, and the width and the height of the output raster extent are multiples of the output cell size. The end result is that the extent of the actual output raster can be slightly larger than what you specified in the extent environment.

Adjusted output raster extent

If the lower-left corner of the extent does not match with any cell corner of the input raster, it will create a shift in the cell alignment between the input and the output raster. This difference of cell alignment will trigger a resampling of the input raster to perform analysis.  Most Spatial Analyst tools use a nearest neighbor resampling technique, except for the Surface tools, which use bilinear interpolation.

You can avoid getting this shift in cell alignment and resampling by specifying a Snap Raster to your input raster in the environment setting.  To know more about Snap Raster, read How the Snap Raster environment setting works.

Check out the new ArcGIS Lesson on Predict Floods with Unit Hydrographs to create a unit hydrograph for a small to medium sized watershed using ArcGIS Pro, using a wide array of tools from Hydrology, Surface  and other toolsets from the Spatial Analyst Extension.

A unit hydrograph, when combined with a rainfall-runoff model, can be a powerful tool in predicting floods. They are relatively easy-to-use tools for quantifying the effects of rainfall on a watershed, and can be used to obtain a reasonable approximation of the flood response of natural watersheds.

A raster of Flow times for the town of Stowe, Vermont

A raster of Flow times for the town of Stowe, Vermont

This lesson is divided into 5 parts, where you begin with preconditioning the elevation model to delineate a watershed. The workflow is then refined to create a velocity field to determine how fast water flows with a spatially variant, time- and discharge-invariant velocity field. Finally, an isochrone map is created to assess the time it takes the water to follow the flow path, and the unit hydrograph is generated at the outlet to predict flooding. You may download the data and follow the complete workflow to go through this analysis.

Have you tried the new Interactive feature input capability in ArcGIS Pro 2.0 yet?  Read on to learn more about how you can perform analysis interactively with some of the Spatial Analyst tools.


Interactive feature input has been added to a number of geoprocessing tools in ArcGIS Pro 2.0, including certain Spatial Analyst tools that can process feature data. Depending on the type of features supported by a particular tool, you have the option to interactively create points, lines, polygons or 3D multipatches. This cool functionality lets you draw input features interactively on the map, and these features then become inputs to your tool.

Let’s go through an example to see how we can create polygon zones to summarize a raster using the Zonal Statistics as Table tool.

With the tool dialog box open, start by clicking the pencil, then select Polygons from the drop-down.

Once you select Polygons, a default polygon drawing tool will be activated and you can start drawing the polygon on the map, or you can choose from a palette of different editing tool used to digitize a polygon, including irregular polygons, autocomplete polygons, right-angle polygons, circles, squares, etc.

Now start drawing the features. For this example, I am comparing Seafloor Dissolved Oxygen (ml/l) at the coastline on both sides of the Gulf of California, and I have chosen the free shape polygon to digitize the zones.

After you finish drawing the polygons on the map, clear selection from the last created feature. Go to the Edit ribbon, select Clear. If you do not clear the selection, the analysis will run only on the last selected feature.

For Zonal Statistics as Table, we need an attribute to uniquely identify each zone. Open the attribute table of the zone polygon layer you just created. You will notice that it already comes with some default fields of different types. We are going to use the ‘Integer Value’ field for the analysis, so will enter a value for each of the polygons, and then save the table.

In the tool, use the ‘Integer Value’ field as the Zone field. Populate the rest of the parameters, specify the output and run with the ‘All’ Statistics type. The output table should appear something like below.

From this example, you learned about using the interactive features input capability in the Zonal Statistics as Table tool.

Apart from Zonal Statistics as Table, Interactive Feature Input is also supported in the following Spatial Analyst tools, grouped by toolset:

  • Distance: Cost Allocation, Cost Back Link, Cost Connectivity, Cost Distance, Cost Path, Euclidean Allocation, Euclidean Direction, Euclidean Distance, Path Distance, Path Distance Allocation, Path Distance Back Link
  • Extraction: Extract by Mask, Extract Multi Values to Points, Extract Values to Points, Sample
  • Hydrology: Snap Pour Point, Watershed
  • Interpolation: IDW, Spline with Barriers
  • Multivariate: Create Signatures
  • Solar Radiation: Points Solar Radiation, Solar Radiation Graphics
  • Surface: Observer Points, Viewshed, Viewshed 2, Visibility
  • Zonal: Tabulate Area, Zonal Geometry, Zonal Geometry as Table, Zonal Histogram and Zonal Statistics.

Now that you know how to use the interactive features, let’s recap a few things:

  • Select the appropriate feature type (points, lines, polygons) from the interactive feature drop-down menu that is supported by the tool parameter. Multipatch is not supported by any of the Spatial Analyst tools, so the tool would fail if it is selected.
  • After drawing some features clear the selection from the last created feature, so that all features are used in the analysis.
  • If the tool requires any attribute to perform the analysis, add the attribute and save it. If you do not add attribute information and specify the field, the tool would either execute on the ObjectId or on some other field, depending on the default tool behavior. If the particular field chosen for your analysis contain null values, the tool would fail to execute.
  • Pick the correct attribute field for executing your tool. Some tools like Zonal Statistics and Zonal Statistics as Table would fail if you do not specify the field on which you want to do the analysis.

To learn more about using interactive feature input with geoprocessing tools, explore the help documentation here. Additionally you can also explore a recent blog post, Streamline Your ArcGIS Pro Geoprocessing Workflows with Interactive Feature Inputs to gain further insights on interactive feature input.

The ArcGIS Spatial Analyst extension provides a broad range of powerful spatial modeling and analysis capabilities, like distance analysis, suitability modeling, terrain analysis, surface modeling, surface interpolation, hydrological analysis, and image classification. You can create, query, map, and analyze raster data; derive new information from existing data and perform integrated raster/vector analysis. Listed below are some resources to help you learn more.

Share your questions and awesome analysis stories with us here at the Geonet Spatial Analyst Forum— We’d love to hear from you! 


What’s New?

  • Resolution preserving cell size projection method (Help, How it works, Blog)
  • GPU processing with Spatial Analyst (Help)
  • What’s New for Spatial Analyst in ArcGIS Pro 2.2 and ArcMap 10.6.1 (Blog)
  • What’s New for Spatial Analyst in ArcGIS Pro 2.1 and ArcMap 10.6. (Blog)
  • What’s New for Spatial Analyst in ArcGIS Pro 2.0 and 10.5.1 (Blog)


New to Spatial Analyst? Start here:

  • Getting started with Spatial Analyst (Technical Workshop)
  • ArcGIS Spatial Analyst Tutorial (Help)
  • Overview of the ArcGIS Spatial Analyst Toolbox (Help)
  • Analysis environments and Spatial Analyst (Help)


Performing analysis with Spatial Analyst 

Suitability modeling

  • Finding the Best Locations Using the Suitability Modeling (Technical Workshop)
  • Understanding the suitability modeling workflow (Case Study)
  • Where are the best locations for a golf resort? (Case Study)
  • Build a Model to Connect Mountain Lion Habitat (Learn ArcGIS Lesson)
  • Finding Optimal Locations: Suitability Modeling in ArcGIS Pro (Training)

Distance analysis

Surface interpolation

Hydrological analysis

Image classification

  • Raster Classification with ArcGIS Desktop (Technical Workshop)
  • Finding the Best Paths for Rovers and Humans on Mars (Esri News)
  • Impervious Surface Mapping using Pro 1.4 – Part 1: Georeferencing (Blog)
  • Impervious Surface Mapping Using Pro 1.4 – Part 2: Classification (Blog)
  • Hands-on experience with the Image Classification Wizard ArcGIS Pro 1.3 (Blog)
  • Pass the classification but hold the salt and pepper (Blog)

Python for Analysis

Integrating different workflows together

  • Aloha! A GIS vacation (Case Study)
  • Minimizing the environmental impact of wind farm installation (Case Study)

Extending analytical capability using script tools

  • Introducing the Storage Capacity Supplementary Tool (Blog)
  • Supplementary Spatial Analyst Toolbox for ArcGIS 10.x. (Blog, Download)




Readily Available Data

Esri Conference Presentations at a glance!

Suggested Books

Harder, C. (2015). The ArcGIS Book: 10 Big Ideas about Applying Geography to Your World. Esri Press.

Mitchell, A. (2012). The ESRI Guide to GIS Analysis Volume 3; Modeling Suitability Movement and Interaction. Esri Press.


Last updated: 05/08/2019

The original resource blog is located here.

It was great to interact with all of you at the User Conference in San Diego. Thank you for sharing your analysis stories, and for your feedback and suggestions. For those of you who could not make it to a particular session or would like to brush up a technical workshop you attended, here is a list of all the presentations that covered raster analysis that you can refer to. Keep us posted on your questions and suggestions.

Raster Analysis

Applied Analysis

Python for Analysis

Related workshops from 2017 International Developer Summit on Python for Raster analysis:

Other 2017 Esri User Conference paper sessions and technical workshop material can be found here. We look forward to seeing you next year!

Check out this Story Map on a spatial data exploratory analysis of vehicle crashes in Richmond City, Virginia that identifies hazardous road segments (hotspots) using both Network Kernel Density Estimation (KDE) and Planar KDE methods for eight different bandwidths.

The analysis includes a data description showing the spatial and temporal distributions of two types of crashes analyzed in this study: speed-related crashes and alcohol-related crashes, and compares the performance of both the methods for finding hotspots of vehicle crashes.  Finally, the workflow answers the question: how similar are the results from the planar spatial analysis method to those from the network spatial analysis method?

This comparison can help you choose the density method you want to use for your analysis to improve road safety planning measures.

Hotspot identified by Network KDE and Planar KDE.

Hotspot identified by Network KDE and Planar KDE.

This analysis and Story Map was created by Ehsanali Keshteh Gar during his summer internship with the Spatial Analyst Team in summer 2017. Ehsanali is currently pursuing his PhD in Geospatial Engineering and MS in Transportation Engineering at Virginia Tech. His research interest is using Network Spatial Analysis to solve transportation problems. For additional questions, you can comment here or contact him at

Many a times, in your analysis, you might need to extract values from rasters based on point locations. The Spatial Analyst extension offers several tools that can do this for you, those being Extract Values to Points, Extract Multi Values to Points and Sample. However, because there are some similarities between them, you may be confused about which one to use. Read on more to find out how to choose the right tool.


Before you start your analysis, let’s ask a few questions:

  • Do you want to extract values from a single raster or multiple rasters?
  • If the input is a multiband raster, do you want to extract values from the first band or all bands?
  • Do you want to append raster values to the input feature class or create a new feature class with the raster values?
  • Do you want to append all the input raster attributes to input feature class?
  • Do you want to extract exact values or interpolated (resampled) values from input raster or rasters?

Answering such questions before hand will help you determine the best way to perform your analysis.


Which tool to choose for your analysis?

Let’s take these questions and have a look at how Extract Values to Points, Extract Multi Values to Points and Sample tools are different from each other.



Extract Values to Points

Extract Multi Values to Points


Does the tool support single raster or multiple rasters as input?

  • Single raster
  • Single raster
  • Multiple rasters
  • Single raster
  • Multiple rasters

If the input raster is a multiband, does the tool execute on the first band or all bands?

The first band

All bands

All bands

What is the output?

Creates a new feature class

Appends raster values to the input feature class

Creates a table

Dose the tool support appending all raster attributes?




When interpolated, what method is supported?

  • Bilinear
  • Bilinear
  • Nearest
  • Bilinear
  • Cubic


This table gives the basic guidance on deciding which tool to use. A few other things to keep in mind are:

  • Extract Values to Points only takes a single raster input. Even when you input a multiband raster, it will only process on the first band by default or the single band defined by you. The raster values are stored in a reserved field called “RASTERVALU”.
  • Extract Multi Values to Points, modifies the input feature by appending the raster values to the attribute table of the input feature. The raster values are stored in the field with the same name as the input raster. However, you can customize the field name with this tool, if you wish.
  • For Sample, the raster values are stored at the field with the same name as the input raster, but you cannot specify the field name. Currently, this is the only extraction tool that support multidimensional raster.


Let’s look at some use cases.


Use Case 1. Extract values from single raster at point locations

Say, you have some meteorological observation sites, and you would like to know the elevation of these locations.


Extract values from single raster at point locations


For this case, the input would be a single elevation raster. You could use any of these three tools, since they all support single raster. Which one to use depends on what kind of output you need. For example, if you need to attach the elevation values to the input feature class’s attribute table, just use Extract Multi Values to Points.


Use Case 2. Extract values from multiple rasters at point locations

Assume, you want to learn the impact of corn production factors using regression. You have sampling locations, and you would like to extract the values of several factors at those locations, such as, temperature, soil moisture, plant population and Nitrogen supply.


Extract values from multiple rasters at point locations

For this case, you would need to extract values from multiple rasters at point locations. Both Extract Multi Values to Points and Sample can do this for you, so use your preferred output format, feature or table, to pick the one to use.



In addition, you might consider the following for your analysis:

  • If you need to specify a certain band, for all these tools, you could expand the multiband raster and select the specified band when you are defining the input raster.
  • If any of the points fall in NoData cells, for all these three tools, the points receive NoData.
  • If any of the points are located outside of the raster extent, for all these three tools, the points receive NoData.
  • If you need to process just a subset of points, you can make a feature selection, or set an environment extent or mask. If you make a selection, Extract Values to Points would create a new feature with only the selected points. Extract Multi Values to Points would update the input feature, and Sample would output a table, by assigning values to the selected points, while unselected points would receive NoData for both these tools. If you use an environment extent or mask, Extract Values to Points will only output the number of points that fall within the processing extent/mask, while Extract Multi Values to Points and Sample would assign NoData to the points that fall outside the processing extent/mask.


Now you know how to best choose the appropriate extraction tool for your analysis. Let us know what you think about it.

The Viewshed 2 tool is a new visibility analysis tool released in ArcGIS 10.3 and ArcGIS Pro 1.0. The tool takes advantage of a GPU processor by default if one is available on your computer.


As GPU graphics cards are commonly available on most of the recent computers, GPU (or CUDA) related error is likely the most common error that you may run into when the Viewshed 2 tool is used for the first time. This blog aims to explain how to resolve the most typical GPU errors that you can encounter while trying to execute the Viewshed 2 tool.

There are two types of errors:


I. GPU error at the beginning of the tool execution


When the Viewshed 2 tool just starts to execute, a GPU error occurs and the tool fails. Example error messages are as follows:

ERROR 010514: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_NO_BINARY_FOR_GPU (209).
ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_INVALID_VALUE (1).


These errors usually indicate that your GPU driver is out of date. To fix this issue, go to the NVIDIA driver update page and search for and install the latest driver for your GPU card. To take this into effect you may have to restart the computer. Rerun the Viewshed 2 tool again.


II. GPU error during the tool execution


If your computer has only one GPU card, by default it will be shared between Windows display and the Viewshed 2 analysis. In this case, the following warning message will be reported at the beginning of the tool execution:

WARNING 010453: The GPU being used is connected to your display. This may cause the computer to appear unresponsive. The display driver may reboot the GPU if the computation takes too long.


If an individual GPU task takes longer than the number of seconds set by the Windows TdrDelay (Timeout Detection and Recovery Delay) registry key the OS may reboot the GPU. This will cause the tool to fail during tool execution. The tool may return the following error messages:

ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_LAUNCH_TIMEOUT (702).
ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_LAUNCH_FAILED (719).


To fix such errors, the value of the registry key TdrDelay needs to be increased. By default, the TdrDelay key value is 2 seconds, it needs to be set to a larger value, such as 100 seconds. This registry key is usually found under the registry path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers. If it does not exist, you may need to add it and set the value appropriately. Restart the computer for the change to take effect. Please take caution when modifying the system registry by either making backup or having a qualified system analyst to perform the change.


If you have more than one GPU card in your system, you may still run into this error if the tool uses the display GPU to perform analysis. To avoid this error is it is recommended to direct the analysis computation to other non-display GPU devices. Follow the given steps below to accomplish this:

  1. Add a new OS environment variable CUDA_VISIBLE_DEVICES, if it does not exist.
  2. Set the value of the environment variable CUDA_VISIBLE_DEVICES to the GPU ID (0 for the first GPU, 1 for the second GPU, etc.) that you want to use for analysis.
  3. Restart ArcMap or ArcGIS Pro application, if you are using it for the analysis.
  4. Rerun the tool again.


These are some of the common GPU errors and solutions to fix them. If the Viewshed 2 tool still fails to execute due to other GPU or CUDA issues, remember that you can always disable GPU from being used and perform the analysis using CPU only. You can do this using the following steps:

  1. Add a new OS environment variable CUDA_VISIBLE_DEVICES, if it does not exist.
  2. Set the value of the environment variable CUDA_VISIBLE_DEVICES to -1 (or a number larger than the count of GPU devices on your computer).
  3. Restart ArcMap or ArcGIS Pro application, if you are using it for the analysis.
  4. Rerun the tool again.


For more details on how to configure GPU devices for analysis, see GPU processing with Spatial Analyst.