ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

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

Analytics

  • Home
  • Applied Analysis
  • Python

Cost-distance analysis workflow using ArcGIS Desktop—Lesson 1: Creating a cost surface

    Download the data

    Welcome to lesson 1 of the cost-distance analysis workflow. Cost-distance analysis is a form of spatial analysis that measures how costly, or expensive, it is to travel over a surface. Cost-distance analysis simulates how a mover will experience the landscape as they travel through it. This is different from Euclidean distance, which captures how far a mover is from known locations in a straight line.

    Cost can be measured in time, dollars, energy expended, or other forms.

    The lessons will walk you through how to most effectively connect the bobcat patches that were identified in the suitability case study (see Lesson1: Exploring and deriving data). This lesson will walk you through how to create a cost surface, which is essential for all cost-distance analysis workflows. Lesson 2 will demonstrate how to create the optimum network of paths to connect the bobcat patches identified in the suitability case study. Lesson 3 will show how to create the optimum least-cost path between a known source and destination, and lesson 4 will identify how to create a wildlife corridor between two patches.

    Creating a cost surface follows similar steps to creating a suitability surface. As in creating a suitability surface, when creating a cost surface, criteria that influence the cost of movement are identified, placed on a common scale, weighted, and combined. Unlike in the final suitability surface where the higher values are more preferred, in the cost surface, the lower values are more preferred (representing lower costs).

    This lesson is divided into seven sections:

    1. Downloading and preparing the tutorial data
    2. Exploring your data and opening and editing the ModelBuilder model
    3. Deriving criteria from base data (elevation)
    4. Using the Reclassify tool to transform categorical data (land use)
    5. Using the Rescale by Function tool to transform continuous criteria (slope)
    6. Weighting and combining criteria in a submodel
    7. Weighting and combining submodels into the overall model

    ArcGIS Spatial Analyst extension is required for this analysis and you must ensure that it is enabled. See Enabling the Spatial Analyst extension.

    These lessons were created in ArcGIS Desktop using version 10.4.1.

    Downloading and preparing the tutorial data

    1. Download the data package at the beginning of this case study.
    2. Browse to the ZIP file in the Downloads folder.
    3. Unzip the ZIP file named CostDistanceAnalysis.
    4. Copy the unzipped CostDistanceAnalysis directory (which contains Data.gdb, Output.gdb, the Toolbooxes folder, and several MXD files) onto the C drive.

    Exploring your data and opening and editing the ModelBuilder model

    1. Open the CostSurface map document by double-clicking the file.

      Opening the CostSurface map document

    2. Two layers are in the table of contents: Landuse and Elevation. First explore the land use map by clicking the map with the Identify tool Identify (found on the Tools toolbar).

      Land use base layer

    3. Turn off Landuse by unchecking the check box next to it in the table of contents. Turn on Elevation by checking the check box next to it. Now explore the Elevation surface as you did with the land use using the Identify tool Identify.

      Elevation base layer

    4. To help keep the different cost-distance analysis workflows organized, the tools will be tracked in several ModelBuilder models. Within the CostDistanceAnalysis folder is a folder named Toolboxes, with a toolbox named CostDistanceAnalysisToolbox.tbx, which contains several models. One of these models will be used to create a cost surface for this lesson. Open ArcCatalog by clicking the ArcCatalog icon Catalog in the taskbar, which will open the Catalog window. From the Catalog window, open the CostSurface model by right-clicking the model and clicking Edit.

      Opening the CostSurface model

    Deriving criteria from base data (elevation)

    Because bobcats respond either directly or indirectly to land use and elevation when traveling, these criteria will be incorporated within an energy submodel in the cost surface model.

    1. Drag the Landuse and Elevation layers from the table of contents into the CostSurface model and align them vertically.

      Dragging Landuse and Elevation layers into the ModelBuilder model

    2. The Slope tool requires Spatial Analyst, so turn on the extension by first clicking the Customize tab in the ArcMap taskbar. Choose the Extensions option from the drop-down list, and check the Spatial Analyst check box to turn it on.

      Browsing to the Extensions dialog box

      Checking the Spatial Analyst extension

    3. Click the ArcToolbox button ArcToolbox in the taskbar at the top of the map document.

      Opening ArcToolbox

    4. Browse to the Slope tool by clicking the Spatial Analyst Tools toolbox and then the Surface toolset.

      Browsing to the Slope tool

    5. Drag the Slope tool into the model and place it to the right of the Elevation layer.

      Adding the Slope tool to the model

    6. Using the Connect tool Connect in the CostSurface ModelBuilder model taskbar, connect the Elevation layer to the Slope tool. Make the connection by clicking the Elevation layer first, and then click the Slope tool. Choose the Input raster option.

      Connecting Elevation to the Slope tool and entering it as the Input raster

    7. Double-click the Slope tool within the CostSurface model to open the tool's dialog box. Type Slope in the Output raster parameter to name the output slope raster. The model automatically saves the file into the Output.gdb geodatabase file. To summarize the input and output layers for the Slope tool, specify the parameters as follows:
      • Input raster data: Elevation
      • Output raster: Slope

      Slope tool dialog box with parameters specified

    8. Click OK to close the Slope tool's dialog box.
    9. Once the dialog box is closed, right-click the Slope tool and click Run to execute the tool.

      Running the Slope tool within the model

    10. Add the output Slope layer to the map document by right-clicking the green Slope(2) layer and clicking Add To Display.

      Adding the output from Slope

    11. Explore the Slope layer within the CostSurface map document. According to the legend, locations that have a gentle or flat slope are green, intermediate slopes are yellow, and steep slopes are red.

      Resulting slope map

    Using the Reclassify tool to transform categorical data (land use)

    Next, the Reclassify tool will be used to transform the values of the Landuse layer onto a common scale. Once both the slope and land use criteria have been transformed onto the same scale, they can be combined into a single layer for the energy submodel within the cost surface model. For more information on transforming data, see the Transforming data onto a common preference scale story map. The Reclassify tool is used to transform the land use values because the data is categorical.

    1. Click the ArcToolbox button ArcToolbox on the Standard toolbar. Browse to the Reclassify tool in the Spatial Analyst Tools toolbox in the Reclass toolset.

      Browsing to the Reclassify tool

    2. Drag the Reclassify tool into the CostSurface model and place it to the right of the Landuse dataset.

      Adding the Reclassify tool to the ModelBuilder model

    3. Connect the Landuse dataset in the model to the Reclassify tool by using the Connect tool Connect. Once the icon is selected, first click the Landuse layer and then click the Reclassify tool. Click Input raster.

      Connecting Landuse to the Reclassify tool and entering it as the Input raster

    4. Double-click the Reclassify tool (yellow rectangle) to open it and enter the following parameters, including the transformed values for each land use category listed in the table. You could reclassify using the CLASS_NAMES field, but since you are only interested in the resulting reclassed values, to simplify the resulting output table and the default symbology the VALUE field will be used.
      • Input raster: Landuse
      • Reclass field: VALUE
      • Output raster: Reclass_Landuse

      VALUENew valuesDescriptions (for reference only)

      1

      10

      Developed, High Intensity

      2

      10

      Developed, Medium Intensity

      3

      9

      Developed, Low Intensity

      4

      7

      Agriculture

      5

      5

      Grassland

      6

      2

      Forest, Deciduous

      7

      1

      Forest, Coniferous

      8

      2

      Forest, Mixed Deciduous-Coniferous

      9

      4

      Scrub/Shrub

      10

      4

      Wetland

      11

      8

      Bare Land

      12

      10

      Water

      Reclassify tool dialog box with parameters specified

    5. Click OK to close the Reclassify tool's dialog box in which you entered the above parameters.
    6. Right-click the Reclassify tool and click Run to execute the tool.

      Running the Reclassify tool within the model

    7. Add the output Reclass_Landuse layer to the display by right-clicking the green output circle and clicking Add To Display.

      Adding the output from the Reclassify tool to the display

    8. Choose a red-to-green color ramp for the Reclass_Landuse layer to help portray each location's cost based on land use. Double-click the Reclass_Landuse layer in the table of contents and change the Color Scheme on the Symbology tab. Select the Stretched display of values from the left pane before choosing a red-to-green color ramp from the drop-down options. Check the Invert check box toward the bottom of the main pane to align red colors with values of high cost and green colors with values of low cost. Click OK once the color ramp has been selected to apply it to the layer.

      Changing the color of the transformed land use using a red-to-green color ramp

    Using the Rescale by Function tool to transform continuous criteria (slope)

    In order to combine the land use and slope criteria into a single submodel pertaining to energy expenditure, transform the slope data onto the same common scale used for land use. Slope data is continuous data; therefore, a continuous function is used to transform its values using the Rescale by Function tool.

    1. Browse to the Rescale by Function tool in the ArcMap toolboxes ArcToolbox.

      Browsing to the Rescale by Function tool

    2. Drag the Rescale by Function tool into the CostSurface model and place it to the right of the output Slope(2) layer (green).

      Adding the Rescale by Function tool to the ModelBuilder model

    3. Use the Connect tool Connect tool in ModelBuilder taskbar to add the Slope(2) output layer to the Rescale by Function tool as the Input raster.

      Connecting the slope output to the Rescale by Function tool and entering it as the Input raster

    4. Double-click the Rescale by Function tool to open it and enter the following parameters:
      • Input raster: Slope (2)
      • Output raster: Rescale_Slope
      • Transformation function: Large
      • From scale: 1
      • To scale: 10

      Rescale by Function tool dialog box with parameters specified

    5. Click OK to save the changes made to the Rescale by Function tool.
    6. Right-click the Rescale by Function tool and click Run to execute the tool.

      Running the Rescale by Function tool within the model

    7. Right-click the output Rescale_Slope layer (green) and click Add To Display to add the output Rescale_Slope layer to the map document.

      Adding the output from Rescale by Function

    8. Change the color ramp of the Rescale_Slope layer so that green indicates areas of low cost. Double-click the Rescale_Slope layer in the table of contents and click the Symbology tab. Choose a red-to-green color ramp from the drop-down list. Check the Invert check box toward the bottom of the main pane. Click OK to save the changes.

      Changing the color of the transformed slope using a red-to-green color ramp

    Weighting and combining criteria into a submodel

    Now that the slope and land use criteria are on the same common scale, they can be combined using the Weighted Sum tool to create the energy expenditure submodel surface.

    1. Browse to the Weighted Sum tool in the ArcMap toolboxes ArcToolbox.

      Browsing to the Weighted Sum tool

    2. Drag the Weighted Sum tool into the CostSurface model and place it to the right of the transformed datasets.

      Adding the Weighted Sum tool to the model

    3. Using the Connect tool Connect in the ModelBuilder taskbar, connect the two layers of transformed data (Reclass_Landuse and Rescale_Slope) to the Weighted Sum tool icon. Choose the Input rasters for both layers.

      Connecting Reclass_Landuse and Rescale_Slope layers to the Weighted Sum tool and entering them as the Input rasters

    4. Open the Weighted Sum tool by double-clicking it, and enter the appropriate weights in the Weight column. Save the output raster as EnergySubmodel in the Output raster parameter and save it within the Output.gdb file geodatabase.
      • Input rasters: Reclass_Landuse, Rescale_Slope
      • Output raster: EnergySubmodel
      • Weights: Reclass_Landuse (1), Rescale_Slope (1)

      Weighted Sum tool dialog box with parameters specified

    5. Click OK to save the changes made to the Weighted Sum tool.
    6. Right-click the Weighted Sum tool and click Run to execute the tool.

      Running the Weighted Sum tool within the model

    7. Add the output EnergySubmodel layer to the display by right-clicking the green output layer and clicking Add To Display.

      Adding the output to the display from Weighted Sum

    8. Choose a red-to-green color ramp for the EnergySubmodel layer to help portray each location's cost based on energy use. Double-click the EnergySubmodel layer in the table of contents and change the Color Scheme on the Symbology tab. To ensure the statistics on the raster are calculated, first choose the Classified option from the left pane and if asked, build the histogram by clicking Yes. Then choose the Stretched display of values from the left pane before choosing a red-to-green color ramp from the drop-down options. Check the Invert check box toward the bottom of the main pane to align red colors with values of high cost and green colors with values of low cost. Click OK once the color ramp has been chosen to apply it to the layer.

      Changing the color of the EnergySubmodel using a red-to-green color ramp

    9. Explore cost surface values within the EnergySubmodel layer by clicking the map in different locations using the Identify tool Identify (found on the Tools toolbar).

      EnergySubmodel surface

    Weighting and combining submodels into the overall model

    To create the final cost surface, the EnergySubmodel will be added to two other submodels already created and available in the Data.gdb file geodatabase: ResourcesSubmodel and SecuritySubmodel. The ResourcesSubmodel and SecuritySubmodel submodels measure costs related to sustenance and physical safety, respectively.

    1. Drag the ResourcesSubmodel and SecuritySubmodel layers from the Data.gdb file geodatabase into the table of contents.

      Adding the ResourceSubmodel and SecuritySubmodel layers

    2. As you just did for the EnergySubmodel, choose a red-to-green color ramp for the ResourcesSubmodel and SecuritySubmodel layers to help portray each location's cost for each submodel. Double-click each layer in the table of contents and change the Color Scheme under the Symbology tab. Select the Stretched option from the left pane before choosing a red-to-green color ramp from the drop-down options. Check the Invert check box toward the bottom of the main pane to align red colors with values of high cost and green colors with values of low cost. Click OK once the color ramp has been selected to apply it to the layer.
    3. Explore the values of the ResourcesSubmodel and SecuritySubmodel using the Identify tool Identify (found on the Tools toolbar).

      Resources submodel—Costs of travel increase farther away from food sources.

      Resources submodel

      Security submodel—Costs of travel increase closer to roads and buildings.

      Security submodel

    4. From the table of contents, drag the ResourcesSubmodel and SecuritySubmodel into the CostSurface model, where they will be combined with the EnergySubmodel to create the final cost surface. Place them underneath the EnergySubmodel output layer.

      Dragging ResourcesSubmodel and SecuiritySubmodel layers into the ModelBuilder model

    5. In the ArcMap toolboxes ArcToolbox, browse to the Weighted Sum tool in the Overlay toolset in the Spatial Analyst Tools toolbox, and add it to the CostSurface model.

      Adding the Weighted Sum tool to the model

    6. Using the Connect tool Connect in ModelBuilder, connect the three submodel layers (EnergySubmodel, ResourcesSubmodel, and SecuritySubmodel) to the Weighted Sum tool icon. Choose the Input rasters option for each.

      Connecting EnergySubmodel, ResourcesSubmodel, and SecuritySubmodel layers to the Weighted Sum tool and entering them as the Input rasters

    7. Open the Weighted Sum tool by double-clicking it, and enter the appropriate weights in the Weight column. Specify the output raster as CostSurface in the Output raster parameter and save it within the Output.gdb file geodatabase.
      • Input rasters: EnergySubmodel, ResourcesSubmodel, SecuritySubmodel
      • Output raster: CostSurface
      • Weights: EnergySubmodel (1), ResourcesSubmodel (1), SecuritySubmodel (1.5)

      Weighted Sum tool dialog box with input parameters specified

    8. Click OK to save the parameters and close the dialog box.
    9. Run the Weighted Sum tool by right-clicking the Weighted Sum tool icon (yellow) and clicking Run.

      Running the Weighted Sum tool within the model

    10. Add the CostSurface output layer (green) to the map document by right-clicking the CostSurface layer and clicking Add To Display.

      Adding the final cost surface to the display

    11. Save the CostSurface model by clicking the Save button Save in the ModelBuilder taskbar. Close the model once it is saved.
    12. Change the colors in which the cost surface is displayed to better indicate high-cost and low-cost areas. Double-click the CostSurface layer in the table of contents and open the Symbology tab. To ensure the statistics on the raster are calculated, first choose the Classified option from the left pane and if asked, build the histogram by clicking Yes. Choose a Stretched display of values from the pane on the left side. From the drop-down list of color ramps, choose a red-to-green color scheme. Invert the direction of the colors by checking the Invert check box near the lower right of the main pane. Click OK once the color ramp has been selected to apply it to the layer.

      Changing the symbology of the final cost surface using a red-to-green color ramp

    13. Explore cost surface values by clicking the map in different locations using the Identify tool Identify (found on the Tools toolbar).

      Final cost surface

    14. Save the CostDistanceAnalysis map document by clicking the Save button Save on the Standard toolbar.

    Congratulations! You have successfully created a cost surface, which is used in all the following lessons for the different cost-distance analysis workflows. In Lesson 2: Creating an optimal connectivity network, the cost surface will be used to connect the optimum bobcat patches identified in Lesson 4:_Locating and connecting regions of the suitability modeling workflow.

    ArcGIS Desktop

    • Home
    • Documentation
    • Support

    ArcGIS

    • ArcGIS Online
    • ArcGIS Desktop
    • ArcGIS Enterprise
    • ArcGIS
    • ArcGIS Developer
    • ArcGIS Solutions
    • ArcGIS Marketplace

    About Esri

    • About Us
    • Careers
    • Esri Blog
    • User Conference
    • Developer Summit
    Esri
    Tell us what you think.
    Copyright © 2021 Esri. | Privacy | Legal