Network analysis, using vector based data layers, can be useful to determine precise routing directions on a given road network. Here, we will determine best routes between destinations using raster datasets that determine cost based on cumulatively calculated cell values. We will use ESRI’s Spatial Analyst tools to perform least cost path analysis.
Through the process of this workshop, you will be creating many new data layers. It is always good practice to designate a path to the geodatabase that you will use to store the layers.
Go to File, Map Document Properties…
Change the default geodatabase by finding the path to the workshop geodatabase you just downloaded.
Also click on the checkbox next to Store relative pathnames to data sources
Load your layers and set your environment for analysis
From the workshop geodatabase, add the following layers to the map (you can drag and drop them from the ArcCatalog side panel on the right:
la
ny
us_rail
us_roads
us_state_capitals
us_states
Go to Geoprocessing, Environment
Set the Processing Extent to us_states
Set Raster Analysis, Cell Size to 10000 (meters)
Set Mask to us_states
[TBS_ALERT color=”info” heading=”What are my units?”]
Are we using feet? Inches? Miles? Or are we more non-American and using meters and kilometers? Your cell sizes and measurements in spatial analysis are dictated by what you chose as the coordinate system for your project. The layers in this workshop’s geodatabase have all been projected to USA Contiguous Albers Equal Area Conic USGS, which has a linear unit of Meters.
[/TBS_ALERT]
As the crow flies… Euclidean Distances and Allocations
How clustered are our state capitals? Which areas of our country are not even remotely close to a state capital? We can visually depict distances from any location in the country to their closest state capital by creating raster layers with cell data with distance measure.
Open the search box and enter euclidean distance
Click on the Euclidean Distance (Spatial Analyst) tool
For input raster, choose us_state_capitals
For output raster, choose your geodatabase, and name it us_state_capitals_euclidean
Maximum distance: 500000
For output cell size, enter 10000
[TBS_ALERT color=”info” heading=”What does the map tell us?”]
Examine the map and explain what you are able to observe. What do the colors represent? What does that tell us about the spatial distribution of our state capitals? Which city is not within 500km of a state capital?
[/TBS_ALERT]
Now, what if we were to redraw our state boundaries? And what if we were asked to do so in away that every single location in the country was allocated to its closest state capital?
Open the search panel, and enter euclidean allocation
Click on the Euclidean Allocation (Spatial Analyst) tool
For input raster, us_state_capitals
For source field, NAME
Name the output allocation raster us_state_capitals_allocation
For output cell size, enter 10000
[TBS_ALERT color=”info” heading=”What does the map tell us?”]
Examine the map and explain what you are able to observe. What do the colors represent? What state would Los Angeles be in?
[/TBS_ALERT]
Finding the “cheapest” route between two cities
First, convert the layers that we will use for our cost analysis into rasters. For this workshop, we will convert our roads and railways.
In the search box, enter Feature to Raster and click on the tool
Input features: us_roads
Field: NewClass
Output raster: us_roads_raster
Output cell size: 10000
Repeat the process but perform it with us_rail
Input features: us_rail
Field: Class
Output raster: us_rail_raster
Output cell size: 10000
In order to calculate the accumulated cost distance from LA, we need to create two rasters: one for distance, and one for direction. This will allow us to later calculate the least cost path from LA to any destination in the US.
Search for cost distance and click on the tool
Input source: la
Input cost raster: us_roads_raster
Output distance raster: CostDistance_LA_roads
Output backlink raster: CostDirection_LA_roads
Also create the cost distance rasters for the railways:
Input source: la
Input cost raster: us_rail_raster
Output distance raster: CostDistance_LA_rail
Output backlink raster: CostDirection_LA_rail
Finally, we are ready to calculate the least cost path between Los Angeles and New York.
Workshop: Spatial Analysis
Network analysis, using vector based data layers, can be useful to determine precise routing directions on a given road network. Here, we will determine best routes between destinations using raster datasets that determine cost based on cumulatively calculated cell values. We will use ESRI’s Spatial Analyst tools to perform least cost path analysis.
To begin, download the workshop geodatabase here:
Setting up your project
Through the process of this workshop, you will be creating many new data layers. It is always good practice to designate a path to the geodatabase that you will use to store the layers.
Load your layers and set your environment for analysis
[TBS_ALERT color=”info” heading=”What are my units?”]
Are we using feet? Inches? Miles? Or are we more non-American and using meters and kilometers? Your cell sizes and measurements in spatial analysis are dictated by what you chose as the coordinate system for your project. The layers in this workshop’s geodatabase have all been projected to USA Contiguous Albers Equal Area Conic USGS, which has a linear unit of Meters.
[/TBS_ALERT]
As the crow flies… Euclidean Distances and Allocations
How clustered are our state capitals? Which areas of our country are not even remotely close to a state capital? We can visually depict distances from any location in the country to their closest state capital by creating raster layers with cell data with distance measure.
[TBS_ALERT color=”info” heading=”What does the map tell us?”]
Examine the map and explain what you are able to observe. What do the colors represent? What does that tell us about the spatial distribution of our state capitals? Which city is not within 500km of a state capital?
[/TBS_ALERT]
Now, what if we were to redraw our state boundaries? And what if we were asked to do so in away that every single location in the country was allocated to its closest state capital?
[TBS_ALERT color=”info” heading=”What does the map tell us?”]
Examine the map and explain what you are able to observe. What do the colors represent? What state would Los Angeles be in?
[/TBS_ALERT]
Finding the “cheapest” route between two cities
First, convert the layers that we will use for our cost analysis into rasters. For this workshop, we will convert our roads and railways.
In order to calculate the accumulated cost distance from LA, we need to create two rasters: one for distance, and one for direction. This will allow us to later calculate the least cost path from LA to any destination in the US.
Finally, we are ready to calculate the least cost path between Los Angeles and New York.
[TBS_ALERT color=”info” heading=”What does the map tell us?”]
Which path has a higher cost? How many state capitals does each path travel through?
[/TBS_ALERT]
[TBS_ALERT color=”alert” heading=”Where can I find out more?”]
Find out more about cost distance analysis here.
[/TBS_ALERT]