NCSU GIS/MEA582:
Geospatial Modeling and Analysis

Buffers, cost surfaces, least cost path

Resources: ESRI Academy (Formerly ESRI virtual campus)

Launch ArcGIS Pro and login with ArcGIS Online credentials if required. Select New> Map> Create New Project. Create a new project in your preferred workspace, in the instructions below we are using the default C:\Users\myname\Documents\ArcGIS\Projects\ folder.

Use your judgement to decide which maps to include in your report. Adjust the colors and symbology of displayed layers to match the cartographic standards (lakes are displayed in blue etc.)

To constrain analyses in a similar manner as g.region, set the spatial extent using the options under Environments, for example:
to constrain analyses results to the extents defined by intersection of input features:

Analysis tab on the ribbon Geoprocessing->Environments-> 'Processing extent'
Choose 'Intersection of Inputs' from the drop down menu.
Click 'Run'

Find developed areas close to lakes

Create the buffers:
On the Map tab, in the Layer group, click 'Add Data'
Browse to C:\Users\myname\Documents\ArcGIS\582data\ncshape.gdb
Select 'lakes'
Browse to C:\Users\myname\Documents\ArcGIS\582data\ncrast.gdb
Select 'landcl96'
In the Geoprocessing pane, search for and select the 'Euclidean Distance' tool
Set 'Input raster' to 'lakes'
Set Output distance raster' to 'lk_dist'
Set 'Maximum distance' to '500'
Leave the rest as defaults 
Click 'Run'

Select the locations that overlay developed areas:

In the Geoprocessing pane, search for and select the 'Raster Calculator' tool
Type in the expression: SetNull( "landcl96" > 2, "lk_dist")
Set the Output raster to 'dev_lakes'
Click 'Run'

Compute cost surface from accident based on speed limits

On the Map tab, in the Layer group, click 'Add Data'
Browse to C:\Users\myname\Documents\ArcGIS\582data\ncshape.gdb
Select 'streets_wake'
In the Geoprocessing pane, search for and select the 'Polyline to Raster' tool
Set 'Input Features' to 'streets_wake'
Set 'Value field' to 'SPEED'
Set 'Output Raster Dataset to 'str_speed'
Set Cellsize to 30
Leave the others as defaults 
Click 'Run'

Verify the working directory then modify mask and cell size:

Analysis tab on the ribbon Geoprocessing->Environments-> 'Workspace' 
verify workspace is set to the assignment  gdb you created at the begining of this assignment
Under 'Raster Analysis' set the 'Cell Size' to 'Same as layer str_speed'
Under 'Raster Analysis' set the  'Mask' to 'boundary_wake' in the ncshape.gdb
Click 'Run'

Assign travel time per cell in hours, compute cost surface.
Assign null values a speed of 5.

In the Geoprocessing pane, search for and select the 'Raster Calculator' tool
Type in the expression: Con(IsNull("str_speed"),5,"str_speed") 
Set the Output raster to 'str_speed2'
Click 'Run'

Calculate the travel time and cost surface.

In ArcGIS cost is defined per map unit (meters in this case). We create a cost raster where cost is time to cross one map unit. Where does the 0.00062137 constant come from?

Create travel time

In the Geoprocessing pane, search for and select the 'Raster Calculator' tool
Type in the expression: 0.00062137 / "str_speed2"
Set the 'Output raster' to str_trv

Create a fire location

Browse to your project GDB in the 'Catalog' pane
right click->new->feature class
set name to 'fire_pt'
select 'point'
click 'finish'
add the layer to your map
From the 'edit' ribbon->'features' group->'Create'
From the 'create features' pane->selec fire_pt
RMC on the map-> 'Absolute x,y,x'
paste '634886' for x and '224328' for y.  Hit the enter key to add the point
'Edit' ribbon->'manage edits' group->save.
clear the selection in the 'selection' group of the 'edit 'window

Create cost surface

In the Geoprocessing pane, search for and select the 'Cost Distance' tool
Set 'Input raster or feature source data' to 'fire_pt'
Set 'Input Cost raster' to 'str_trv'    
Set 'Output distance raster' to 'str_cost'
Set 'Output backlink raster' to './Buffers_cost/backlink'
Leave the rest as defaults
Click 'Run'

Find cost from selected firestations

Find cost

On the Map tab, in the Layer group, click 'Add Data'
Browse to C:\Users\myname\Documents\ArcGIS\582data\ncshape.gdb
Select 'firestations'
In the Geoprocessing pane, search for and select the 'Sample' tool
Set 'Input rasters' to 'str_cost'
Set 'Input Location raster or point features' to 'firestations'
Set 'Output table' to 'station_costs'
Leave everything else as defaults
Click 'Run'

Add the table of costs (NOTE: this should be added automatically at the bottom of the Contents pane). However, if the table does not get added:


Map->layer-> Add Data ->
Select 'station_costs' from your project GDB

Open the station_costs table and sort on the field 'STR_COST_Band_1':

RMC 'station_costs' -> Open
RMC column named 'STR_COST_Band_1' and choose 'Sort Ascending'
Note the range of cost values.
Close the table

Find shortest path from nearby firestations.
Note: create the firestations as a shapefile if the below does not work with geodatabase firestations.

In the Geoprocessing pane, search for and select the 'Cost Path' tool
Set 'Input raster or feature destination data' to 'firestations'
Set 'Destination field' to 'OBJECTID'
Set the 'Input cost distance raster' to 'str_cost'
Set the 'Input cost backlink raster' to 'backlink'
Set the 'Output raster' to 'cost_path'
Set the 'Path type' to 'BEST_SINGLE'   
Click 'Run'

Note: to see the resulting least cost (drive-time) path you may have to turn off some or most of the layers in your TOC. How does this compare to the table values?