Skip to content

v3_Utilitiy Create Walkability Cost Raster

Donald Ebert edited this page Oct 3, 2024 · 6 revisions

Create Walkability Cost Raster

Available with Spatial Analyst license.

Summary

Generates a cost surface raster suitable for the Pedestrian Access and Availability tool. The output raster will consist of three values representing walkable areas, walking-resistant areas, and impassable areas.

Usage

  • Multiple polyline and/or polygon feature layers can be supplied for Walkable features. Features from each layer used in the Output cost raster creation can be limited to just selected features.

  • Multiple polyline and/or polygon feature layers can be supplied for Impassable features. Features from each layer used in the Output cost raster creation can be limited to just selected features.

  • NOTE: For the most accurate results and shortest processing times, it is highly recommended that all input layers be in the same spatial reference.

  • Values entered for the Maximum travel distance, Walk value, and Base value should be in the same linear units as the Output cost raster.

    • NOTE: Linear units will be obtained from the geoprocessing environment output coordinate system. If no specific geoprocessing environment output coodinate system is set (i.e., environment output coordinate system equals "NONE", this tool will temporarily set it to match the geocoordinate system of the Snap raster.
  • The Impassable value for the Output cost raster will be auto-calculated as (Maximum walking distance / Cost raster cell size) rounded up to the nearest integer.

  • The default values of 800 for Maximum travel distance, 1 for Walk value, and 10 for Base value assume the Output cost raster has meters for linear units and a 10-meter Cost raster cell size. Given these parameters and a calculated impassable value of 800, a pedestrian could travel across 80 continuous Walk value cells, and 10 continuous Base value cells.

  • Final output is written to the location specified in the Output cost raster parameter. The Output cost raster may be saved in a file folder or a geodatabase.

    • NOTE: For most consistent results, it is highly recommended that tool output be saved to a file geodatabase.

    • When saving in a File Geodatabase, no extension is permitted for the Output cost raster name.

    • When saving in a file folder, the following extensions are allowed for the Output cost raster name:

      • .img for ERDAS IMAGINE

      • .tif for TIFF

      • No extension for Esri Grid

    • NOTE: Filename lengths and allowable characters are dictated by the output raster format and its file destination. Please see, 'Output raster formats and names', in ArcGIS Pro's Online Help for more detailed information.

  • Where Walkable features and Impassable features occur in the same Output cost raster grid cell, the Walkable features take priority and the Walk value is assigned to that cell. It is assumed that Walkable features can cross an otherwise impassable area via a bridge, a sidewalk, or other such structure.

  • Areas in between walkable cells and impassable cells are assigned the Base value.

  • It is recommended that the extent and cell size of the Snap raster match the desired cell size and extent of the Pedestrian Access and Availability tool's Output raster.

    • NOTE:If a raster is to be used as the Population or polygon feature for the Pedestrian Access and Availabilty tool, it is recommended that the Snap raster and Processing cell size be set to that population raster.

    • NOTE: If no specific geoprocessing environment extent is set (i.e., environment extent equals "NONE", "MAXOF", or "MINOF"), this tool will temporarily set it to match the geocoordinate system of the Snap raster. It will be reset upon tool completion.

  • In Additional Options, the user may elect to 'Retain Intermediate Layers Generated During Metric Processing', and/or 'Record Process Steps Taken During Metric Calculation'.

    • Retain Intermediate Layers Generated During Metric Calculation

      • Choosing INTERMEDIATES retains several of the key intermediate products (e.g., rasters, feature classes, tables) used to generate the final tool output. By examining the intermediate products, the user can gain a better understanding how the metric is calculated. The following intermediate products are listed in the general order they are generated:

        • cwcr_Walk_Line_Merge_# (vector) - A vector feature class created by merging all line features found in Walkable features. The attribute table consists of required ArcGIS fields (e.g., OBJECTID, Shape, Shape_Length) and the first field from the first Walkable features line layer. This latter field is not used in any future calculations. It contains values for features from the layer is was copied from, but NULL values for the rest of the merged features. This feature class is only produced if more than one line feature layers are in Walkable features.

        • cwcr_Walk_Raster_Line_# (raster) - Raster created from all line feature layers in Walkable features. If more than one line feature layers are present, they are merged into a single feature class, cwcr_Walk_Line_Merge_#, before rasterization. This raster is only produced if one or more line feature layers are provided in Walkable features.

        • cwcr_Walk_Poly_Merge_# (vector) - A vector feature class created by merging all polygon features found in Walkable features. The attribute table consists of required ArcGIS fields (e.g., OBJECTID, Shape, Shape_Area) and the first field from the first Walkable features polygon layer. This latter field is not used in any future calculations. It contains values for features from the layer is was copied from, but NULL values for the rest of the merged features. This feature class is only produced if more than one polygon feature layers are in Walkable features.

        • cwcr_Walk_Raster_Polygon_# (raster) - Raster created from all polygon feature layers in Walkable features. If more than one polygon feature layers are present, they are merged into a single feature class, cwcr_Walk_Poly_Merge_#, before rasterization. This raster is only produced if one or more polygon feature layers are provided in Walkable features.

        • cwcr_Walk_Raster_# (raster) - Raster created by combining cwcr_Walk_Raster_Line_# and cwcr_Walk_Raster_Polygon_#.

        • cwcr_Impass_Line_Merge_# (vector) - A vector feature class created by merging all line features found in Impassable features. The attribute table consists of required ArcGIS fields (e.g., OBJECTID, Shape, Shape_Length) and the first field from the first Impassable features line layer. This latter field is not used in any future calculations. It contains values for features from the layer is was copied from, but NULL values for the rest of the merged features. This feature class is only produced if more than one line feature layers are in Impassable features.

        • cwcr_Impass_Raster_Line_# (raster) - Raster created from all line feature layers in Impassable features. If more than one line feature layers are present, they are merged into a single feature class, cwcr_Impass_Line_Merge_#, before rasterization. This raster is only produced if one or more polygon feature layers are provided in Impassable features.

        • cwcr_Impass_Poly_Merge_# (vector) - A vector feature class created by merging all polygon features found in Impassable features. The attribute table consists of required ArcGIS fields (e.g., OBJECTID, Shape, Shape_Area) and the first field from the first Impassable features polygon layer. This latter field is not used in any future calculations. It contains values for features from the layer is was copied from, but NULL values for the rest of the merged features. This feature class is only produced if more than one polygon feature layers are in Impassable features.

        • cwcr_Impass_Raster_Polygon_# (raster) - Raster created from all polygon feature layers in Impassable features. If more than one polygon feature layers are present, they are merged into a single feature class, cwcr_Impass_Poly_Merge_#, before rasterization. This raster is only produced if one or more polygon feature layers are provided in Impassable features.

        • cwcr_Impass_Raster_# (raster) - Raster created by combining cwcr_Impass_Raster_Line_# and cwcr_Impass_Raster_Polygon_#.

        • NOTE: To ensure unique filenames, intermediate filenames are typically generated using the CreateScratchName ArcPy function. This function provides a unique name for the intermediate product by appending a number to a filename prefix. The number starts at 0 and is incremented until a unique filename for the output workspace is found. The generated number is represented in this manual by the hashtag (#) symbol.

        • NOTE: The appended number may not be the same for all intermediate products saved during a tool run. Running a tool with different input options can result in different intermediate products being produced. If a tool is run more than once using the same output workspace, different number suffixes may be generated depending on the files already present in the output workspace.

      • Intermediate products are saved to one of the following locations:

        • When the Output cost raster is saved as a File Geodatabase Raster, intermediate products are placed in the same file geodatabase.

        • When the Output cost raster is saved in a file folder, a file geodatabase named "attilaScratchWorkspace" is automatically generated in the same output location specified for the Output cost raster. Intermediate products are placed in the attilaScratchWorkspace file geodatabase.

        • NOTE: ATtILA will report the location of the saved intermediate products in the Tool Details' Messages section.

    • Record Process Steps Taken During Metric Calculation

      • Choosing LOGFILE will generate a text file containing information on system setup, tool inputs, parameter selections, script operations, and any encountered error or warning messages.

      • Log files will be named, [Output table]_[date_time].txt, with the date represented as YYYYMMDD and time as hh_mm_ss.

      • Where the log file is saved is dependent on the Current Workspace environment setting:

        • When the Current Workspace is a geodatabase, the log file will be located in the folder that contains that workspace.

        • When the Current Workspace is a folder, the log file will be located in that folder.

        • NOTE: In ArcGIS Pro, the default value for the Current Workspace environments is the project default geodatabase.

        • NOTE: ATtILA will report the name and location of the log file in the Tool Details' Messages section.

Syntax

CWCR (Walkable_features, {Impassable_features}, Maximum_travel_distance, Walk_value, Base_value, Output_cost_raster, Cost_raster_cell_size, Snap_raster, {Select_options})

Parameter Explanation Data Type
Walkable_features The vector polyline and/or polygon Feature Layers that define walkable routes.

If selected features exist in the input feature layers, the user can elect to use only those features for generating the Output cost raster.
Multiple Value
Impassable_features (Optional) The vector polyline and/or polygon Feature Layers that define impassable features.

If selected features exist in the input feature layers, the user can elect to use only those features for generating the Output cost raster.
Multiple Value
Maximum_travel_distance The distance where further travel is not possisble.

This value is used along with the Cost raster cell size to define the Output cost raster's impassable value in the Output cost raster. Impassable value = (Maximum walking distance / Cost raster cell size) rounded up to the nearest integer.

If the output Cost surface raster is to be used in the Pedestrian Access and Availability tool, the value entered should equal the input for that tool's Maximum travel distance parameter.

The value units must be a positive integer value, and in the linear units of the Output cost raster.
Long
Walk_value The cost of traveling through a walkable cell.

The value defines the cost of least resistance.

Value units must be a positive integer value, and in the linear units of the Output cost raster.
Long
Base_value The cost of traveling through a walking-resistant cell.

The value defines the cost of difficult, but passable, resistance.

Value units must be a positive integer value, and in the linear units of the Output cost raster.
Long
Output_cost_raster The output cost surface raster.

It is always an integer raster.
Raster Dataset
Cost_raster_cell_size The cell size of the output raster that will be created.

Units use the linear unit of the geoprocessing outputCoordinateSystem environment setting. If no outputCoordinateSystem is set, the Snap raster's linear unit is used.
Double
Snap_raster The raster that the cell alignment of the Output cost raster will be set to.

The Snap raster's linear unit will be used for the Cost raster cell size if no outputCoordinateSystem environment is set.
Raster Layer
Select_options Tool options available to provide additional information:

  • Retain Intermediate Layers Generated During Metric Calculation - Saves key intermediate products (e.g., rasters, feature classes, tables) used to generate the final tool output.
  • Record Process Steps Taken During Metric Calculation - Saves a log file containing information on tool inputs, selections, and operations.
Multiple Value

Code Samples

Create Walkability Cost Raster example 1 (Python window)

This example generates a cost surface raster where the cell values represent that cell's resistance to movement (1 = easy, 10 = resistant, and 80 = impassable). One line feature layer was entered as input for walkable pathways, while barriers to movement were represented by two line and one polygon feature layers.

import arcpy
from arcpy.sa import *
arcpy.ImportToolbox(r"D:\Destination Folder\ATtILA v{#}.tbx")
from ATtILA2 import metric

Walkable_features = "Roads_Walkable",
Impassable_features = "Roads_NonWalkable;Water_Lines;Water_Polygons",
Maximum_travel_distance = 800,
Walk_value = 1,
Base_value = 10,
Output_cost_raster = r"D:\pyexamples\results.gdb\WalkabilityRaster",
Cost_raster_cell_size = 10,
Snap_raster = r"D:\pyexamples\data.gdb\NLCD_2016",
Select_options = ['INTERMEDIATES  -  Retain Intermediate Layers Generated During Metric Calculation','LOGFILE  -  Record Process Steps Taken During Metric Calculation']

arcpy.ATtILA.CWCR(Walkable_features,
				  Impassable_features,
				  Maximum_travel_distance,
				  Walk_value,
				  Base_value10,
				  Output_cost_raster,
				  Cost_raster_cell_size,
				  Snap_raster,
				  Select_options)

Create Walkability Cost Raster example 2 (Tool Details Messages)

This is a sample capture of the geoprocessing messages generated during a typical tool run. It is provided here to assist in the understanding of the tool's processing steps.


Start Time: Day, Month DD, YYYY hh:mm:ss AM/PM
Created log file: workspace path\\filename
Started: YYYY-MM-DD hh:mm:ss Setting up environment variables
Intermediates are stored in this directory: workspace path
[YYYY-MM-DD hh:mm:ss] Using NLCD_2016's extent for geoprocessing steps.
[YYYY-MM-DD hh:mm:ss] Using NLCD_2016's spatial reference for geoprocessing steps: Albers_Conical_Equal_Area
[YYYY-MM-DD hh:mm:ss] Processing Walkability features
[YYYY-MM-DD hh:mm:ss] Converting Roads_Walkable to raster. Intermediate: cwcr_Walk_Raster_Line_1
[YYYY-MM-DD hh:mm:ss] Setting converted raster cell values to 1 where features exist. Everywhere else will be set to 10. Intermediate: cwcr_Walk_Raster_1
[YYYY-MM-DD hh:mm:ss] Impass Value = 80. Calculated as (Maximum walking distance / Cost raster cell size) rounded up to the nearest integer
[YYYY-MM-DD hh:mm:ss] Processing Impassable features
[YYYY-MM-DD hh:mm:ss] Merging 2 line features from input features. Intermediate: cwcr_Impass_Line_Merge_1
[YYYY-MM-DD hh:mm:ss] Converting cwcr_Impass_Line_Merge_1 to raster. Intermediate: cwcr_Impass_Raster_Line_1
[YYYY-MM-DD hh:mm:ss] Converting Water_Polygons to raster. Intermediate: cwcr_Impass_Raster_Polygon_1
[YYYY-MM-DD hh:mm:ss] Combining converted rasters and setting output cell values to 80 where features exist. Everywhere else will be set to 10. Intermediate: cwcr_Impass_Raster_1
[YYYY-MM-DD hh:mm:ss] Combining the Walkable raster with the Impassable raster for final output
Log file closed
Succeeded at Day, Month DD, YYYY hh:mm:ss AM/PM (Elapsed Time: ##.## units)

Tags

There are no tags for this item.

Credits

There are no credits for this item.

Use Limitations

There are no access and use limitations for this item.


arrow_up Top of the page     |     arrow_left Land Cover on Slope Proportions     |     arrow_right Neighborhood Proportions


Table of contents

Clone this wiki locally