ArcGIS Spatial Analyst Blog - Page 2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Latest Activity

(39 Posts)
JianLange
Esri Contributor

Reclassification is the process of reassigning one or more values in a raster dataset to new output values. The Reclassify tool is available in the Spatial Analyst extension in both ArcMap and ArcGIS Pro. If you are used to working with ArcMap, there are some noticeable differences in the Reclassify workflow in ArcGIS Pro. Here is a blog post about the best practices of using the Reclassify tool in ArcGIS Pro Spatial Analyst extension, especially when migrating from ArcMap.

Reclassify Raster Data in ArcGIS Pro Spatial Analyst Extension

more
1 0 954
SarmisthaChatterjee
Esri Contributor

Suitability modeling is one of the most common applications for a GIS analyst. It can be used to determine the best location to build a shopping center, housing development, or ski resort. You can also use it to find the best areas for parks, endangered wildlife habitat, or flood control. Suitability modeling is one of the first applications you are taught when learning GIS. It is the application that made you fall in love with GIS.

Traditionally, creating a suitability model is a linear process. You needed to understand the steps in the workflow in which you independently specify the parameters for each criterion with little knowledge of their effect on the output. You had to trust the process when creating the output.

The new Suitability Modeler is an interactive, exploratory environment for creating and evaluating a suitability model. It is available now for ArcGIS Pro 2.6 with a Spatial Analyst extension license.

The basic premise underlying the Suitability Modeler is that a model is a dynamic process. Constructing a suitability model is a nonlinear, iterative process. At each step of the workflow, analytical feedback is provided through interacting maps, plots, and panes. This allows you to make informed decisions on the parameters you specify and easily see how they will affect the final output.

The Modeler allows seamless back and forth movement between each stage of the model development. What you learn in one stage of the process may influence the decisions you make in another.

Because of the exploratory and interactive nature of the Suitability Modeler, you can justify each step of your modeling process. As a result, you will be more confident in the model output leading to better decisions.

The best way to understand the Suitability Modeler is to see it in action. The following video was presented at the Plenary of the 2020 Esri User Conference.

To learn more about the Suitability Modeler, see What is the Suitability Modeler?

To understand the general steps of a suitability model, see The general suitability modeling workflow.

The content of the blog The new Suitability Modeler: Changing the way suitability models are created is written by Kevin Johnston. Kevin has been a Product Engineer on the Spatial Analyst development team for over 29 years. He has degrees in Landscape Architect from Harvard and in environmental modeling from Yale. At Esri, Kevin’s current focus is developing suitability and connectivity tools. He hopes the tools that he works on can help users make more informed decisions.

more
1 0 1,863
JuanLaguna
Esri Contributor

The Spatial Analyst extension has many new and improved capabilities in ArcGIS Pro 2.6.  One of the most exciting things is the new Suitability Modeler, which is an interactive way to identify the best location to site things. New and improved tools and functions are available across several analysis categories, including density, distance, extraction, generalization, local, multidimensional, segmentation and classification, surface,  and zonal.  Many more tools, functions and operators have been updated to directly support multiband raster data. If you have been using the Raster Cell Iterator in ArcPy, we’ve added a way to improve the performance.

In addition to this overview, we will have several blog posts that cover some of these changes in more detail coming out soon, so remember to check back regularly.

Where do I get it?

ArcGIS Pro 2.6 was released on July 28, 2020. Click the following link to get to Download page.

For a complete summary of all the changes that have been made for this release, have a look at What’s New for ArcGIS Pro 2.6.

What’s changed for Spatial Analyst?

Here are the main categories of the changes for this release:

  1. Suitability
  2. Density
  3. Distance
  4. Zonal
  5. Multiband
  6. Surface
  7. Segmentation and classification
  8. General tool and function enhancements
  9. ArcPy

1. The new Suitability Modeler

If you have used the capabilities of the Spatial Analyst extension in the past to do site selection, you will be familiar with the back-and-forth, iterative and manual process it can take to get to your final answer.

Well, there is now a better way!

The new Suitability Modeler is a dynamic, exploratory environment of interacting panes, plots, and maps allows you to create refined suitability models. It guides you through the steps and provides immediate feedback, so what you learn in one step may influence your decisions in another. Please give it a try and let us know what you think

The following graphic shows the primary interface elements of the Suitability Modeler, including the ribbon, the tabs of the modeler pane, and the transformation graphs.  We’ll have more information coming out soon that will fully introduce the capabilities and the workflow to follow.

2. Density analysis

The Kernel Density tool has a new parameter that allows barrier features to be considered when calculating kernel density for the planar method. The tool has also been enhanced to work with the parallel processing environment, and efficiency has been improved by using a new search algorithm.

3. Distance analysis

The Optimal Region Connections tool has a new parameter that determines if the paths will continue within the input regions.

To follow the pattern established in the Distance toolset where the original tools were moved into their own Legacy Distance category,  the raster functions for distance analysis have been similarly restructured.  In the list of raster functions, those in the Distance group should be the ones used for analysis going forward.  The functions provided in previous releases have been relocated to the new Distance (Legacy) group.

The new Optimal Path As Raster raster function has been added to the Distance group.

4. Zonal analysis

The Tabulate Area tool now processes overlapping polygon zones and calculates the area for each zone separately. You can also represent the input classes as rows or fields using the Classes as rows in output table parameter.

The Zonal Statistics and Zonal Statistics as Table tools and the Zonal Statistics raster function have a new percentile statistics type to compute extreme events. These tools and function can now also process both multidimensional zone and value rasters. Also, have a look at the How the zonal statistics tools work help topic, which has been substantially rewritten to better explain the operation of these tools.

The Zonal Histogram tool can now create histogram graphs. You can also represent the input zones as rows or fields using the Zones as rows in output table parameter.

5. Multiband raster analysis

Most local operations now have the capability to perform band-wise aggregation for multiband input rasters.  This includes nearly all of the Math tools, functions and operators, as well as the Con tool and Con function.

The Equal To Frequency, Greater Than Frequency, Less Than Frequency, Popularity, and Rank tools have a new parameter, Process as multiband, that gives you more control over how multiband input rasters are processed when creating single-band or multiband output.

 

6. Surface analysis

The Aspect tool has a new parameter, Project geodesic azimuths, to correct the angle distortion caused by the output spatial reference. These angles can be used to accurately locate points along the steepest downhill slope. This parameter is available only when the Method parameter is set to Geodesic.

The Cut Fill tool now calculates cut and fill operations using eight-way connectivity.

7.  Segmentation and Classification analysis

The Train Maximum Likelihood Classifier, Train Random Trees Classifier, and Train Support Vector Machine Classifier tools have a new parameter to contain dimension values in the input training sample feature class.

The Export Training Data For Deep Learning tool has a new default option for the Meta Data Format parameter, changing from KITTI Labels to PASCAL Visual Object Classes.

The Segment Mean Shift tool has a new parameter for setting the maximum size of a segment.

8. General tool and function enhancements

Several other tools have been optimized for improved performance or had specific new capabilities added.

Extraction analysis:

  • The Sample tool can now create a point feature class output or a table with new Generate feature class parameter.

Generalization analysis:

Local analysis:

  • The Combine tool has been rewritten to perform better. There is now no limitation on the number of input rasters that can be specified.

Multidimensional raster analysis:

9. ArcPy enhancements

In the Raster Cell Iterator class in ArcPy, you can now handle NoData cells more efficiently by optionally skipping them with the skipNoData key to increase the performance of your analysis.

Spatial Analyst resources

Do you have our Spatial Analyst resources blog post bookmarked?

Not only does it include a list of links to informative content, it is also updated as new resources become available.  For example, here are some blog posts that explain the Raster Cell Iterator that was introduced in the previous Pro release:

Summary

As you can see, quite a lot of new functionality and capabilities have been made available in this release. Please download it and give it a try.  As always, we welcome your feedback.  If you happen to encounter any difficulties, please let us know.

more
1 0 1,506
SarmisthaChatterjee
Esri Contributor

We are excited to share with you some of the important improvements that we did in the Zonal toolset for ArcGIS Pro 2.6 and ArcGIS Image Server 10.8.1 to make your workflows more intuitive and powerful. We have significantly improved and enhanced the geoprocessing tools, the corresponding raster functions, the ArcGIS API for Python and the ArcGIS REST API.

New enhancement in zonal functionalities now included new capabilities, options, and ways of accessing the tools. Read on to learn more about it.

Process overlapping polygon zones

The Tabulate Area tool in ArcGIS Pro 2.6 Spatial Analyst extension now process overlapping zones and calculates area for each individual feature.

Calculate percentile

The zonal statistics tools and the function have an additional statistics type, percentile, to compute extreme events. Using the Zonal Statistics as Table tool, you can also calculate multiple percentile values at one go, as shown below:

 ZSAT_Percentile

This capability can be accessed from:

ArcGIS Pro 2.6 Spatial Analyst and Image Analyst extensions:

- Zonal Statistics as geoprocessing tool and function

- Zonal Statistics as Table as geoprocessing tool

ArcGIS Image Server 10.8.1:

- Summarize Raster Within as Map Viewer toolPortal tool in ArcGIS ProArcGIS API for Python and ArcGIS REST API

- Zonal Statistics as Map Viewer function and ArcGIS API for Python

- Zonal Statistics As Table as Portal tool in ArcGIS Pro and ArcGIS REST API

Process multidimensional zone and value rasters

The zonal statistics tools and function can now process both multidimensional zone and value rasters. This capability is enabled by checking the parameter Process as multidimensional, as shown in the example below.

ZS_MD1

These tools are also available from the Multidimensional ribbon, which was introduced in ArcGIS Pro 2.5.

ZS_Ribbon

The zonal operation occurs slice-by-slice between the slices of the zone raster and the slices of the current variable from the value raster. See How the zonal statistics tools work to learn more about the multidimensional processing in these tools.

MDzonevalue_SameDim_illus

Multidimensional zone and value input rasters with the resulting zonal statistics raster are shown.

This capability can be accessed from:

ArcGIS Pro 2.6 Spatial Analyst and Image Analyst extensions:

- Zonal Statistics as geoprocessing tool and function

- Zonal Statistics as Table as geoprocessing tool

ArcGIS Image Server 10.8.1:

- Summarize Raster Within as Map Viewer toolPortal tool in ArcGIS ProArcGIS API for Python and ArcGIS REST API

- Zonal Statistics as Map Viewer function and ArcGIS API for Python

- Zonal Statistics As Table as Portal tool in ArcGIS Pro and ArcGIS REST API

See what else is new with multidimensional raster analysis from this blog post: Let’s do data science III: Multidimensional Raster Analysis in ArcGIS Pro

New output table schema

A new table output schema is available for the Tabulate Area and Zonal Histogram tools with ArcGIS Pro 2.6 Spatial Analyst extension, which facilitates further query and analysis on the output tables. In the Tabulate Area tool, you can now choose between representing the input classes as rows or as fields in the output table with the Classes as rows in output table parameter. Similarly, to improve analysis workflows, in the Zonal Histogram tool, you can represent the input zones either as rows or as fields, using the new Zones as rows in output table parameter.

NewTableSchema_zonal

Create histogram 

The Zonal Histogram tool in ArcGIS Pro 2.6 Spatial Analyst extension can now create histogram graphs. Just note that the zonal histogram graph is not generated by default. In order to create the graph, first check the Zones as rows in output table parameter and specify an output graph name.

ZonalHist

Also, do not forget to check out the What’s New for Spatial Analyst in ArcGIS Pro 2.6 to know about everything that is new with the Spatial Analyst tools.

What else is new in ArcGIS Image Server?

The Zonal Statistics As Table tool is now available in ArcGIS Image Server as a Raster Analysis portal tool and as an ArcGIS REST API task to calculate the values of a raster within the zones of another dataset and report the results to a table.

To learn more about what’s changed in ArcGIS 10.8.1, see What’s new in ArcGIS Image Server.

more
0 0 1,928
SarmisthaChatterjee
Esri Contributor

The 2020 Esri User Conference (July 13-16) is almost here, and we are going virtual! So, if you haven’t already, register to join the world’s largest, virtual GIS conference and be able to access the plenary, technical sessions, and many other presentations. We here on the Spatial Analyst team are excited to show you what we’ve been working on since last summer.  If you do any kind of raster or imagery analysis, or work with multidimensional data, look at the guide below to plan out your time with us.

Streaming Live Plenary Session

Join us for three inspiring days of thought-provoking Plenary Session content. Don’t miss out on the brand-new Interactive Suitability Modeler, which will be covered in the Monday, July 13, 10:00 am – 12:00 pm PDT timeslot.

Streaming Live Technical Sessions

Take advantage of this unique learning experiences and check out the following technical workshops with live Q&A:

You can find out more about these and all other sessions from the full schedule. You can also filter the schedule based on your interest or level to find out the sessions you would like to attend. If you are interested in sessions related to Spatial Analysis and Data Science, don’t forget to check out this blog.

On-Demand Sessions

The following on-demand sessions can be accessed starting on July 13th for all registered attendees. You can view the recordings at your convenience.

As you are attending the sessions, make sure to give us your feedback, so that we can improve them for the next round. We would also like to hear from you while you are attending the conference, so visit us virtually at the Esri UC 2020 expo in the Spatial Analysis and Data Science showcase to learn more about the ongoing projects, or if you have questions. You can also follow our Spatial Analyst Resources blog page to get updates throughout the year.

Download the Spatial Analyst UC 2020 Workshops and Demos List.

Enjoy the conference!

more
2 0 686
by Anonymous User
Not applicable

If you’ve read through the Introducing the Raster Cell Iterator blog, you’ll be familiar with the basic concepts of the Raster Cell Iterator (RCI), a new ArcPy class added in ArcGIS Pro 2.5 in the Spatial Analyst module that allows you to iterate over raster cells, query and modify individual cell values.

In this blog, let’s explore how RCI can be used to customize your analysis on problems that cannot be easily solved using the existing out-of-the-box geoprocessing tool. In the first example, we will use RCI to create a new raster with a specific spatial pattern – checkerboard. And in two other examples, we will use RCI to customize two focal operations: 1) count the number of neighboring cells that have a different value from the center cell, and 2) calculate the minimum slope from a DEM.

Create a new raster with the checkerboard pattern

In atmospheric modeling, a heterogenous surface raster represented by a checkerboard pattern can be used as an initial condition for idealized model simulations. However, there is not an existing geoprocessing tool with which you can create such a raster directly. In earlier ArcGIS releases, you can accomplish this task by using NumPy, but it would require a multi-step workflow to do so.  In ArcGIS Pro 2.5 with RCI, this task has become much easier! You simply need to assign a binary value to each cell based on the current row and column while iterating through a raster.  Following is a simple code sample which does exactly that.

import json    
from arcpy.sa import RasterInfo, Raster  
  
# Create an empty RasterInfo object  
myRasterInfo = RasterInfo()  
  
# Load raster info from a Python dictionary  
myRasterInfoData = {  
  'bandCount': 1,  
  'extent': {  
    'xmin': -107.0,  
    'ymin': 38.0,  
    'xmax': -104.0,  
    'ymax': 40.0,  
    'spatialReference': {'wkid': 4326},  
  },  
  'pixelSizeX': 0.01,  
  'pixelSizeY': 0.01,  
  'pixelType': 'U8',  
}  
	  
# Convert myRasterInfoData to a JSON string and load into myRasterInfo  
myRasterInfo.fromJSONString(json.dumps(myRasterInfoData))  
  
# Create a new Raster object based on myRasterInfo  
myRaster = Raster(myRasterInfo)  
  
for (r, c) in myRaster:   
    # Checkerboard with 10 pixels width  
    if r % 20 < 10 and c % 20 < 10 or r % 20 >= 10 and c % 20 >= 10:  
        myRaster[r, c] = 1  
    else:  
        myRaster[r, c] = 0

myRaster.save(r 'C:\output\checkerboard.tif')  ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

From the code snippet above, lines 8-23 show the steps to construct a RasterInfo object from scratch. Line 26 creates an empty raster based on the raster info specified in the previous step. Lines 28-33 show the main logic of creating a checkerboard pattern raster by assigning binary values to the cell based on the current row and column. An implicit way of using Raster Cell Iterator is demonstrated by calling a simple For loop to go through all the cells. Since there is only one raster involved in this analysis, you don’t need to create a RasterCellIterators object explicitly. It is recommended to follow this pattern when you are working with only one raster. Finally, at line 35, we are saving the output raster. Figure 1 shows the output raster with the checkerboard pattern.

Output raster with the checkerboard pattern

Figure 1. Output raster with the checkerboard pattern

Custom Focal Operations

Focal operations produce an output raster dataset in which the output value at each cell is a function of the input cell value at that location and its neighboring cell values. With RCI, you can customize these kinds of focal operations with more flexibility.

Count the number of neighboring cells that have a different value from the center cell

Stathakis & Tsilimigkas (2015) proposed several metrics to calculate the compactness of cities using land use adjacency information. To derive the compactness metric, one of the pre-processing steps is to iterate through the land use data and count the number of neighboring cells that have a value different to the center cell. This focal operation process is illustrated in Figure 2.

Examples of input and output with the operation counting the number of neighboring cells that have a value different to the center cell.

Figure 2. Examples of input and output with the operation counting the number of neighboring cells that have a value different to the center cell.

RCI makes it much easier to iterate over all cells and compare each cell value with its neighbors using a simple if logic. Here’s how you can do it yourself:

from math import isnan    
from arcpy.sa import Raster, RasterCellIterator    
    
landu = Raster(r"C:\sample_data\landuse.tif")    
# Create a temporary output raster based on the raster info of landuse    
output = Raster(landu.getRasterInfo())    
   
with RasterCellIterator({'rasters':[landu, output]}) as rci:    
    for i,j in rci:    
        count = 0     
        # Assign NoData value to the output if the input is NoData    
        if isnan(landu[i,j]):    
            output[i,j] = math.nan    
            continue    
        # Create a moving window    
        for x in [-1,0,1]:    
            for y in [-1,0,1]:    
                # Count the number of adjacent cells with a different value      
                if not isnan(landu[i+x,j+y]) and landu[i+x,j+y] != landu[i,j]:    
                    count+=1    
        output[i,j] = count    
output.save(r"C:\output\landuse_diff_count.tif")   ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

In line 6, we are creating a new empty raster using the land use raster as an input template. Line 8 creates a RasterCellIterator object explicitly using input and output. In lines 9-21, we are looping through all cells in the input raster, and for each cell comparing its value to each of its immediate neighbors based on its relative position.

While performing the analysis, it is required to check for the NoData cells in the input, so that an appropriate value can be assigned to the output raster.  In lines 12 and 19, we are using isnan() function from the math module to check if the cell value in the input raster is NoData.  Line 13 uses nan from the same math module to represent NoData. In this example, NoData values are not considered while iterating through the cells and they are excluded from the neighbor cells when counting. The input land use data and the final output raster used in the sample code are shown in Figure 3.

The figure on the left shows the input land use raster dataset. The figure on the right shows the output raster with values ranging from 0 to 8, which counts the number of neighboring cells that have a different value from the center cell.

Figure 3. The figure on the left shows the input land use raster dataset. The figure on the right shows the output raster with values ranging from 0 to 8, which counts the number of neighboring cells that have a different value from the center cell.

Calculate minimum slope from a DEM

For the Slope geoprocessing tool, the slope value of each cell is determined by the rates of change of the elevation in the horizontal and vertical directions from the center cell (How slope works). In some cases, you might be interested in calculating the slope using a different equation. For an example, when building a fish trawlability model, an analyst might want to use a slope of the seabed that is based on the minimum change of elevation across each cell. By creating a custom focal operation with RCI, the following example shows how to calculate the minimum slope for your bathymetric DEM:

from arcpy.sa import Raster, RasterCellIterator

dem = Raster(r'C:\sample_data\demtif.tif')
cell_x = dem.meanCellHeight
cell_y = dem.meanCellWidth
raster_info = dem.getRasterInfo()

# Set the output pixel type to be float 32 
raster_info.setPixelType('F32')
min_slope = Raster(raster_info)
with RasterCellIterator({'rasters':[dem, min_slope]}) as rci:
    for r,c in rci:
        slopes = []
        # Iterate through 8 neighbors 
        for x,y in [(-1,-1),(-1,0),(1,0),(0,-1),(0,1),(1,1),(-1,1),(1,-1)]:
            # Calculate the slope from center cell to each neighbor
            slope = abs(dem[r,c]-dem[r+x,c+y])/math.sqrt(cell_x**2+cell_y**2)
            # Add all the slope values to a list
            slopes.append(slope)
        # Assign the minimum slope to the output cell value 
        min_slope[r,c] = min(slopes)
min_slope.save(r'C:\output\min_slope.tif')‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

In the code sample, lines 13-21 implement the main logic for calculating the minimum slope. For each cell from DEM, we iterate through its eight neighbors and calculate the rate of change. Then we find the minimum slope and assign that value to the output cell. Note that in line 9, the pixel type is set as ‘F32’, which means that the output is expected to be a 32-bit floating raster. In this example, the raster info of the slope output is inherited from the input DEM data. If the pixel type of your DEM data is integer, you need this step to make sure that the slope value of each cell is calculated as a floating-point value instead of an integer.

Summary

In this blog, we went through three different examples of using Raster Cell Iterator in ArcPy, each of them showing how easy it is to perform custom raster analysis. We hope you start using this simple but powerful capability to extend your own raster analysis capabilities.  Please let us know if you have any questions or want to see other examples and use cases.  You can also pass along any cool applications you come up with, and we can share your solutions with the community at large!

Reference:

Stathakis, D., & Tsilimigkas, G. (2015). Measuring the compactness of European medium-sized cities by spatial metrics based on fused data sets. International Journal of Image and Data Fusion6(1), 42-64.

The original blog post Unleash the power of RasterCellIterator to perform custom raster analysis has been written by Hao Hu and Yu Wang.

more
1 1 893
JuanLaguna
Esri Contributor

Do you use Spatial Analyst extension for performing raster analysis?  With the release of ArcGIS Pro 2.5, we have made significant changes in the areas of distance analysis, multidimensional raster analysis, and zonal analysis. There is also whole host of improvements across many other areas.  If you are comfortable in ArcPy, there is an exciting new way to perform custom raster analysis.  Also in ArcPy, many new functions are available for analyzing, visualizing, and managing raster data using Python.

We will have many more blog posts coming that go into much more detail on some of these changes, and they will be linked to below.

Where do I get it?

ArcGIS Pro 2.5 was released of in February 6 of this year.

For a quick summary of all the changes that have been made for these releases, have a look at the What's New topic (and video!) here:

ArcMap Desktop 10.8 and ArcGIS Enterprise 10.8 will be released very soon.  Watch this space, or your usual channels, for more details once they become available.

What's changed for Spatial Analyst?

Here are the main categories of the changes.

  1. Distortion free distance analysis
  2. Multidimensional raster analysis
  3. Multiband raster analysis
  4. Zonal analysis
  5. General tool and function enhancements
  6. Iterating over raster cells using ArcPy
  7. Modifying raster cell values using ArcPy
  8. Enhanced multidimensional raster processing with ArcPy
  9. Additional raster functions available in ArcPy

1.  Distortion Free Distance Analysis

With ArcGIS Pro 2.5, Spatial Analyst sees a significant change in distance analysis capabilities.  First and foremost, a new algorithm for cost-based distance analysis provides more accurate and precise results than before.  By avoiding the distortion in output that was caused by the previously-used network model of cell connectivity, several benefits are achieved:

  • Cost accumulation is measured the same way in all directions. An important special case is that cost distance with a constant cost surface now produces the same output as Euclidean distance mapping.
  • Surface distance over a digital elevation model is computed much more accurately.
  • Paths around barriers are followed more accurately.
  • Cost distance accumulation and allocation analysis have the option to perform the analysis using either a planar or a geodesic method.

As part of making this improved capability available, the distance toolset has been reorganized into fewer but more capable tools.  The Corridor tool is carried over as-is. The new tools are:

Rest assured, all the tools that existed in the previous release are still available; they have simply been moved into a new sub-toolset.  We have a help topic that well covers the migration from legacy to distortion free distance tools.

To complement the new GP tools, two new raster functions are available in the Distance group:

Updates have been made to the following existing raster functions:

  • The Least Cost Path function has been updated to use the Distance Accumulation tool to perform distortion-free distance analysis.
  • The Cost Path function has been updated with a new parameter that allows you to determine a hydrological flow path.

Related blog:

 

In ArcMap 10.8, the Distance toolset remains basically the same as before.  The only exception is that the Cost Path and Cost Path As Polyline tools have been updated with a new parameter which provides the option to make those tools treat the input backlink raster as a flow direction raster instead.

2.  Multidimensional Raster Analysis

As part of the increased focus on multidimensional analysis in the ArcGIS platform, a number of tools in various toolsets have been updated to directly support multidimensional raster data. There is also a new pathway for accessing multidimensional analytical tools directly from the ArcGIS Pro interface.

In the Multidimensional Analysis toolset, the following tools have improvements:

In the Extraction toolset, the Sample tool has several new parameters to process multidimensional data.  When processing this type of data, the tool has options to specify the following:

  • The output table layout, either as rows or columns
  • The time, depth, or other acquisition information associated with the location features to extract information for a given time or calculate statistics within a period of the observation time
  • Lines and polygons as the input location, in addition to points and rasters
  • The Parallel Processing Factor environment

In the Zonal toolset, the Zonal Statistics tool, the Zonal Statistics as Table tool, and the Zonal Statistics raster function now have the Process as multidimensional parameter available, which allows you to calculate various statistics on each slice of a multidimensional value raster.

 In ArcGIS Pro, for the Raster Layer tab, the new Multidimensional tab is enabled when a multidimensional raster layer or a multidimensional mosaic layer is selected in the Contents pane. It provides tools and functionality for working with multidimensional raster data.

3.  Multiband Raster Analysis

Not to be confused with multidimensional rasters, multiband rasters are raster datasets that are composed of two or more raster bands, or layers, where each band is a measure of a single characteristic. The following tools have changes pertaining to how multiband raster data is handled. 

  • The Aggregate Multidimensional Raster tool can now do band-wise aggregation for multiband multidimensional input.
  • The Pick and Cell Statistics tools have a new parameter that allows you more control over how multiband input rasters are processed.
  • The Cell Statistics raster function can calculate single-band or multiband output based on the multiband processing type.

4.  Zonal Analysis

In response to an often-requested capability, the Zonal Statistics as Table tool now processes overlapping polygon zones. The statistics for each zone are calculates separately.

 

5.  General tool and function enhancements

In addition to the changes described above, some new other new tools and tool enhancements are available.

  • In the Raster segmentation and classification toolset, a new tool, Linear Spectral Unmixing, has been added to perform subpixel classification and calculate the fractional abundance of different land cover types for individual cells. The Export Training Data For Deep Learning tool has four new parameters.
  • For generalizing rasters, the Aggregate tool now supports the Parallel Processing Factor environment. The Median option for the Aggregation technique now only produces a float output raster, regardless of the input type. The new Aggregate raster function dynamically generalizes a raster in the display at a reduced resolution. When the output from the function is persisted, it will be generated at the full resolution.
  • A new Random raster function is available for creating a dynamic raster on the fly with random cell values.

 

6.  Iterating over raster cells using ArcPy

With ArcGIS Pro 2.5, a powerful new capability to perform custom raster analysis is available to you in ArcPy.  Two classes are introduced that allow you iterate over rasters programmatically.

The RasterCellIterator class in the Spatial Analyst module allows you to visit each cell location in a raster. The iterator makes it easy to inspect cell values at each location, as well as neighboring locations. While iterating over a raster, you can read and write cell values.

The RasterInfo class in the ArcPy classes describes a set of raster properties that facilitate the creation of a new raster dataset using the Raster object. This class has several methods and properties available.

Related blogs:

 

7. Modifying raster cell values using ArcPy

The Raster object now allows you to read cell values using a [row, column] index notation (also known as neighborhood notation).  In addition to reading values, you can also assign a new value to a particular raster cell, thereby modifying the Raster object. Once the values of raster cells have been modified through an assignment, you can persist these changes by calling the save() method on the Raster object.

 

8. Enhanced multidimensional raster processing using ArcPy

The Raster object has more capabilities for processing multidimensional rasters.  The additional properties and methods are:

  • Properties—bandNames, blockSize, noDataValues, properties, and readOnly
  • Methods—addDimension, exportImage, getProperty, getRasterBands, getRasterInfo, read, removeVariables, renameVariable, setProperty, and write

 

9. Additional raster functions available in ArcPy

In the Spatial Analyst module, many new ArcPy functions are available for analyzing, visualizing, and managing raster data using Python.  To keep things organized, they are grouped into functional categories, which you can see from Overview page.

 

New resources

Do you have our Spatial Analyst resources blog post bookmarked?

Not only does it include a list of links to informative content, we also work to keep it updated as new resources become available.  For example, here is some of the material that was recently added:

Summary

That about covers what's changed since the last release.  Once you've downloaded and installed the latest versions of the software, give it a try.  We hope you will enjoy the improvements and enhancements.

more
1 0 860
by Anonymous User
Not applicable

Have you ever wished you could easily interact with raster datasets in ArcGIS Pro at an individual cell level? Be able to read and write cell values directly, and create your own custom analysis routines? Look no further, as the Raster Cell Iterator (RCI) in ArcGIS Pro 2.5, lets you do just that. RCI is available through the Spatial Analyst module, an extension of the ArcPy Python site package. With RCI, visit each cell location in a Raster object, all in a Python environment. The iterator makes it easy to query and modify cell values at each cell location and its neighboring cell locations. Iterable access to raster cells enables you to write custom raster analysis scripts and combine them with the existing suite of Spatial Analysis geoprocessing tools, expanding your analytical capabilities immensely!

Here is a short video that helps you get started with RCI and shows how to use it for custom raster analysis.

As you can see in this video, using RCI is very simple and requires few lines of coding. You can invoke RCI on a single raster object or multiple raster objects to iterate through their row and column indices. Using these indices, you can query a cell value at a given cell location. You can also query neighborhood cell values by using relative indexing. Additionally, you can use index notation to write cell values to an output raster.

Be sure to download the latest version of ArcGIS Pro 2.5 to try out RCI and explore its capabilities.

Additional Resources

Read A quick tour of using Raster Cell Iterator to get started with RCI in ArcGIS Pro.

Read the blog Unleash the power of RasterCellIterator to perform custom raster analysis, which illustrates how to apply RCI to solve a read-world problem.

more
3 1 1,947
SarmisthaChatterjee
Esri Contributor

The Spatial Analyst team has made some important improvements in the Distance toolset for ArcGIS Pro 2.5.
We have significantly improved the precision of the geoprocessing tools in the Distance toolset and the corresponding raster functions. We have also provided additional capabilities which let you answer some new “how much/how many/how far” questions.

These improvements allows us to remove the strong distinction between the “Euclidean” and “Cost” Distance tools. The number of tools has been reduced from 17 to 6. The new user experience is now simplified to:

1. Enter Sources

2. Do you have barriers?

3. Do you have a surface?

4. Do you have a cost surface?

5. Do you need to consider direction of motion and other source characteristics?

The new toolset organization is shown in Figure 1 below. The new tools are:

Figure 1 - Organization of the Distance toolset at ArcGIS Pro 2.5

The original Distance tools that you are familiar with are available in the  Legacy sub-toolset.
The Spatial Analyst team recommends that you move your Euclidean and Cost Distance analysis work to the new tools.

Why should I use the new tools?

At ArcGIS Pro 2.5, we’ve uniformly adopted a new algorithm [4] for all distance mapping tools. This algorithm removes the distortion in outputs caused by using a network model of cell connectivity, as shown in Figure 2 on the left below. This has the following benefits:

  • Cost distance is now measured the same way in all directions. An important special case is cost distance with a constant cost surface now produces the same output as the Euclidean distance tools.
  • Surface distance over a digital elevation model can now be precisely computed.
  • Paths around barriers are now followed precisely, as shown in Figure 3.

Figure 2- Output of legacy Cost Distance tool using a constant cost input with barriers encoded as ndoata, along with output of legacy Cost Path As Polyline tool.

Figure 3 – Output of new Distance Accumulation tool with barrier inputs, along with output of new Optimal Path As Line tool.

At ArcGIS Pro 2.4, we introduced this improvement in a limited context: Euclidean distance with barriers. ArcGIS Pro 2.5 generalizes and extends this work.

What else is new?

Along with this fundamental change to the behavior of the cost distance algorithm, several additional capabilities have been added.

Figure 4- Geodesic flight paths from some Northern European airports to LAX, but avoiding paths over southern Greenland.

  • As a side effect of the improved algorithm, you can now create buffer regions whose distance is measured over the surface of a digital elevation model. This isn’t really a separate capability, but it’s important enough to mention explicitly. In the example below, the study area is Lake Wakatipu near Queenstown, New Zealand – a high relief area. Notice how, in such areas, the output of the Distance Accumulation tool (gray gradient) with a maximum accumulation cutoff of 1500m “pulls away” from the output of the vector Buffer tool that used a buffer distance of 1500m. This surface-aware distance computation can be done in either planar or geodesic mode.

Figure 5 – Comparison of planar (blue) and surface distance (gray gradient) buffers around Lake Wakatipu in the Queenstown area of New Zealand. Both buffers extend to a distance of 1500m, but the gray gradient output measures distance over the surface of a DEM instead of distance in the plane of the data’s projected coordinate system.

  • Using the new Optimal Path as Raster tool, you can count how many least cost paths pass through a cell en route from some destinations to a source.

Figure 6 – Optimal Path As Raster output from ridgeline hiking trail in SW to access road in NE. Green is less intense usage, red is more intense.

  • Using the new source_location output from Distance Accumulation and Distance Allocation, you can do intensity mapping of the boundary of sources, showing where most cost paths in the study area would end up, without plotting all cost paths. The RasterCellIterator python object, also new at ArcGIS Pro 2.5, makes this type of intensity calculation very easy to perform. See A quick tour of using Raster Cell Iterator to know more about it.
  • Figure 7 – Lake Wakatipu, New Zealand. Hot spots (red and blue fuzzy dots), computed from Distance Accumulation output, show locations of most intense drainage into lake from surrounding watershed.

Which geoprocessing tools and raster functions should I start using?

For each legacy distance tool that you are currently using, table 1 shows you which new tool to switch to.

Table 1 – Upgrade guide for distance mapping tools
If you usedThen switch to
Cost DistanceDistance Accumulation
Cost BacklinkDistance Accumulation with back direction output
Cost AllocationDistance Allocation
Euclidean DistanceDistance Accumulation
Euclidean AllocationDistance Allocation
Euclidean DirectionDistance Accumulation with source direction output
Path DistanceDistance Accumulation
Path BacklinkDistance Accumulation with back direction output
Path AllocationDistance Allocation
Cost PathOptimal Path As Raster
Cost Path As PolylineOptimal Path As Line
Cost ConnectivityOptimal Region Connections

For new workflows, the back direction raster replaces the back link raster. The Optimal Path as Raster/Line tools no longer accept a backlink raster as input (they will still accept a flow direction raster). If you were using the backlink raster in a workflow that involves something other than the Cost Path or Cost Path As Polyline tools, then the Spatial Analyst team would like to hear from you. The Euclidean distance blog mentioned above discusses the backdirection raster in more detail.If you used the maximum_distance parameter in the legacy cost tools, you should now use the Maximum Accumulation parameter in the “Characteristics of the sources” parameter group.

These are the new raster functions.

The functions have the same parameters as the tools, with an important difference: the functions optionally emit multi-band outputs. This avoids having to run these (possibly expensive) global functions twice to get closely related outputs (like accumulated cost surface and back direction raster).

Also, the Least Cost Path raster function has been updated to use the Distance Accumulation tool behind the scenes.

Finally, although not directly related to these enhancements, your advanced use of the Distance toolset needs to consider if direction of motion between sources and destinations is important. If so, please check out this blog on Creating accumulative cost surfaces using directional data.

References

1) Goodchild, M. F. (1977). An Evaluation of Lattice Solutions to the Problem of Corridor Location. Environment and Planning A. 9. 727-738. 10.1068/a090727.
2) Sethian, J. A. (1997). Tracking Interfaces with Level Sets: An “act of violence” helps solve evolving interface problems in geometry, fluid mechanics, robotic navigation and materials sciences. American Scientist Vol. 85, No. 3 (MAY-JUNE 1997), pp. 254-263
3) Sethian, J. A. (1999). Level set methods and fast marching methods: evolving interfaces in computational geometry, fluid mechanics, computer vision, and materials science (2nd edition). Cambridge University Press.
4) Zhao, H. (2005). A fast sweeping method for eikonal equations. Mathematics of computation, 74(250), 603-627.

The original blog post has been written by James TenBrink, and is available here, What’s New in the Spatial Analyst Distance Toolset in Pro 2.5James TenBrink is a senior software engineer in the raster analysis group at Esri. He has a Bachelor of Science degree in Computer Science from Hope College in Holland, Michigan, and a Master of Science degree in Computer Science from Rensselaer Polytechnic Institute in Troy, New York. He has been with Esri 28 years and has had an office in almost every building, on almost every floor, of the Esri campus.

more
2 0 1,384
SarmisthaChatterjee
Esri Contributor

The following question was recently posted to GeoNet:

“I want to add wind direction and strength to a cost distance surface. How do I create a raster surface which incorporates these two factors…?“

In this blog post, the spatial analyst team responds to this user’s question.

The Path Distance tool in the Spatial Analyst toolbox can do part of this. It can be used to create an accumulative cost surface from costs that are determined by the direction of the wind. Unfortunately, Esri doesn’t yet have a way to make cost of motion vary based on both the direction and speed of the wind.

Also, when using Path Distance, it is extremely important to know in advance whether you intend to move from source cells to other cells, or vice versa. You will see that changing this intent changes the result dramatically.

If you decide to use Path Distance to incorporate only wind direction into your accumulative cost surface, here is what we recommend:

You can encode wind direction azimuths (clockwise 0-360 from north, both 0 and 360 are treated as “north”) in the input horizontal raster. In figure 1 below, a 10 x 10 horizontal raster is shown. It has a constant cell value of 90 and represents wind blowing to the east with some uniform speed over the study area.

You should not use wind speed as the friction cost surface, because that cost is paid regardless of which direction you travel through a cell. In fact, Path Distance doesn’t need a cost friction surface at all (nor do the other Path Distance tools: allocation, backlink).

Figure 1-A 10 x 10 horizontal direction raster used as input to Path Distance. Each cell has a value of 90 (wind blowing from west to east). Cell centers are shown in yellow, along with a vector field renderer (blue arrows).

Case 1: Motion from source

Let’s first assume that:

  • You are sitting on the single source point (the selected blue point in the center of the raster in figure 2).
  • That its easiest to move with the wind and impossible to move either against it or at right angles to it.
  • That you want to calculate accumulated cost from your source cell to every other cell in the study area.

For this case, you could use a horizontal_factor parameter value of Horizontal Forward Function AND (this is important) a source_direction parameter value of “FROM_SOURCE”. The result is shown in figure 2. You can see that your accumulated cost surface is only defined in areas that can be reached travelling with (or somewhat with) the wind.

Figure 2- The results of using Path Distance with the horizontal raster from figure 1 and the horizontal forward function. The single source is the selected point in the center and we want to know how expensive it is to reach other cells in the study area. The accumulated cost surface shows that we are only allowed to move with the wind, and its easiest to move directly east. For this result, we use the horizontal forward function AND a source_direction parameter value of motion from source.

Lets go into a bit of detail on how Path Distance turns wind direction into a travel cost (also called a weight). We zoom in on the single source cell and its 8 neighbors:

Figure 3 - Detail of source cell (marked with an S) and its 8 neighbors. Each cell has a wind direction.

From that source, we can move in 8 directions to reach a neighbor cell and we need to figure out what the step cost for that move will be.

Figure 4 - You can move 8 ways from the source cell to its neighbors. Each choice makes a different angle relative to each cell's wind direction.

In our case, the only thing that affects the step cost is wind direction. Each of those 8 step directions makes some angle with the preferred moving direction, which in this case is the wind direction.

HRMA calculation

We call this angle the horizontal relative moving angle (HRMA) because it is your direction of motion relative to an azimuth value stored in your horizontal raster. Each horizontal factor function turns this HRMA into a weight. In this case, we’ve used the Horizontal Forward Function. See this help topic for more details on HRMA.

The HRMA and horizontal factor function are evaluated twice for each of the 8 possible steps: once for the wind direction at the source cell and once for the direction at the neighbor cell. The two results are then averaged to get the horizontal weight to be used when calculating the cost of a step into the neighbor cell.

Case 2: Motion To Source

Now let’s assume that the single source point represents a location that you want to reach from other points in the study area. In this case, all inputs to Path Distance remain the same, except you now choose a source _direction parameter value of “TO_SOURCE”. Figure 5 shows the result. As you can see, the results are very different.

Figure 5 -The result of using Path Distance to find accumulated cost of travelling to the single source point from other cells in the study area: source_direction is set to “ motion to source”. All other inputs are the same as for figure 2.

Why are these results so different? In both cases, the accumulative cost surface is grown outward starting from the source and visiting all other cells; but in the TO_SOURCE case, the calculation of the HRMA is different, so the output of the horizontal factor function applied to that HRMA will also be different. In the TO_SOURCE case the HRMA is the geometric supplement of the HRMA calculated in the FROM_SOURCE case, as shown in figure 6.

HRMA value changes based on direction of motion

To summarize:

Path distance can adjust the cost of motion through a cell based on input data that describes, for each cell, the easiest direction to move through the cell. This calculation can produce very different results, based on whether you want to move from a source to other cells, or from other cells back to the source.

We haven’t explicitly talked about the vertical raster and vertical factor functions, but the reasoning process is basically the same as described above. However, instead of accounting for horizontal influences, the vertical factor determines the cost to overcome the changes in elevations (the slopes) between the cells.

The original blog content has been written by James TenBrink and Kevin Johnston and is available here: https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/creating-accumulative-cost-surfaces-u... 

James TenBrink is a senior software engineer in the raster analysis group at esri. He has a Bachelor of Science degree in Computer Science from Hope College in Holland, Michigan, and a Master of Science degree in Computer Science from Rensselaer Polytechnic Institute in Troy, New York. He has been with esri 28 years and has had an office in almost every building, on almost every floor, of the esri campus.

Kevin Johnston has been a Product Engineer on the Spatial Analyst development team for over 29 years. He has degrees in Landscape Architect from Harvard and in environmental modeling from Yale. At Esri, Kevin’s current focus is developing suitability and connectivity tools. He hopes the tools that he works on can help users make more informed decisions.

 

more
0 0 649
105 Subscribers