Due Date: March 29th
Instructor: Xiaozhong Sun (xs243@cornell.edu)
Lab TAs: Wenzheng Li (wl563) / Ishan Keskar (iuk3) / Aditi Parihar (ap973)
Location: Sibley 305, Barclay Gibbs Jones Computer Lab
Total Points: 100
For this lab we will need to utilize a network dataset. A network dataset is an intelligent model of the road system. It contains not only the location and attributes of roads but also information about how roads relate to one another, such as which roads are connected, which turns between connected roads are allowed or prohibited, and other information that affects what travel paths are possible, and how long travel takes. A networked dataset can be created from a georeferenced street network polyline file. To learn how to do this, click here. For the purposes of this lab, we will provide you with a readily available networked data set.
Please remember to open a new map session for each part of the lab!
The closest facility solver finds one or more facilities that are closest to an incident based on travel time or travel distance, and outputs the best routes as driving directions between the incidents and the chosen facilities.
Open ArcGIS Pro. Create a new project for this lab.
In the Catalog pane, navigate to your folder and expand
SanFrancisco.gdb and Transportation. Drag
SanFrancisco_ND
Using the on-the-fly method, set the projection to match California State Plane. Not sure which zone to use for the San Francisco Bay area? Look it up.
By default, network datasets built with traffic data show traffic conditions for the current time when they are added to the map. This network dataset includes historical traffic, so you are seeing typical traffic conditions for the current time and day of the week.
Now go to the data folder and add the hospital layer.
The closest facility analysis layer stores all the inputs, parameters, and results of a closest facility analysis.
On the Analysis
tab, click
Network Analysis
—>
Closest Facility
If you click Closest Facility in the Contents pane, the Closest Facility tab appears in the Network Analyst group at the top of ArcGIS Pro. Click Closest Facility to see the tab’s controls. You’ll use these controls to define the closest facility results you want to generate.
Now you want to add facilities to your analysis. You’ll use the Hospitals feature class to load the Facilities sublayer into network analysis class. To do so:
Closest Facility
tab, click
Import Facilities
. The Add Locations
window
appears.Input Network Analysis
Layer is set to
Closest Facility
and Sub Layer
is set to
Facilities
.Input Locations
and
choose Hospitals
. This is the point feature class you
previously added to the map.A total of 9 hospitals loads as facilities. Then we need to add an incident. Consider an accident site as an incident. The closest facility solver finds one or more hospitals that are closest to the accident location.
Find the incident layer in the data folder and add it to the map.
Under Closest Facility, click the Import Incidents
button, set sub layer to Incidents
and
Input Locations
to Incidents
. Click Ok.
The address is added to the Incidents
sublayer of the
Closest Facility
analysis layer.
The Closest Facility
tab includes a
Travel Settings
section, where you can specify properties
for the analysis.
Travel Settings
group, in the
Facilities
text box, increase the value to 3. The closest
facility solver will search for a maximum of three hospitals from the
accident site.Cutoff
text box, type 5. The closest facility
solver will look for hospitals that can be reached within 5 minutes from
the incident site. Hospitals outside the cutoff time are ignored. Since
the current impedance is Travel Time
, the units are in
minutes.Direction
drop-down list, select
Towards Facilities
.Now run the process to identify the closest facilities: go to the
Directions
group, check the Output on Solve
,
which will generate directions upon solve.
When the solve process is complete, routes appear in the map display
and in the Routes
sublayer of the
Closest Facility
group layer.
Directions
group, click
Show Directions
On the Analysis
tab, in the Workflows
group, click Network Analysis
–>
Route
Contents
pane. This could
take a few minutes.
The Network Analyst Window now contains empty lists of Stops, Routes and Barriers categories: point, line, and polygon. Additionally, the Contents pane contains a new Route Analysis Layer.
Note: To see or change the network data source that will be used to create the network analysis layer, you can click the
Network Analysis
drop-down menu and look underNetwork Data Source
.
Route
tab on top to see the control settings. You
will use these controls to define the route you want to generate.Now let’s add a Stop. You will add the stops between which you will be creating the best route.
Route
tab, under theInput Data
group, click Create Features
Route: Stops
, use the Point
toolEdit
tab, click
Attributes
Select
tool
and edit their attributes, such as Name
and
Sequence
. Sequence helps to change the order in which the
stops will be visited. Specify a visiting order for the three stops, and
you will also find the numbers you assigned appears on each stop in the
map.Route
tab, click Run
. The results
show the fastest path through the network, connecting all the stops you
created based on the sequence you specified.Route
tab, in the
Travel Settings
group, choose the Sequence
drop-down menu and select the Find Best
option. Click
Run
. The resulting route will now show the best sequence to
visit all the stops.In this section, you will add a barrier on the route that represents a roadblock and will find an alternate route to the destination, avoiding the roadblock.
Create Feature
button, select
Route: Polygon Barriers
, click
Polygon Barriers
.Polygon
toolRoute
tab, click Run
.The map now shows a different route that avoids the area covered by the barrier you created.
Map 1: Create a map layout of your route with stops and barriers. Include at least streets and shorelines. Symbolize appropriately. Include all the elements you deem necessary.
Next, we will create a series of service area polygons, which represent the distance that can be reached from a facility within a specified amount of time. We will calculate 3-minute and 5-minute service area polygons for hospitals in San Francisco (A more accurate measurement than distance buffer).
Network Analyst
toolbar dropdown menu, click
Service Area
. The Network Analyst Window now contains an
empty list of Facilities, Barriers, Lines, and Polygons categories.
Additionally, the Contents pane contains a new Service Area analysis
layer.Click Service Area
to see the tab’s controls. We’ll use
these controls to define the service area you want to generate:
Think of a facility as the starting location of a vehicle. The service area solver simulates all possible paths the vehicle can travel within an elapsed time when departing from the facility.
Since ambulances are typically parked at hospitals, we first load the hospitals into the Facilities sublayer.
Service Area
tab, in the Input Data
group, click
Import Facilities
Add Locations
window appears.Input Network Analysis Layer
is set to
Service Area
and Sub Layer
is set to
Facilities
.Open the attribute table of Facilities, we can find there are 9 hospitals are added as facilities.
Now we will set the service area. In the Travel Settings group, change the Cuttoffs value to 3, 5 (Enter this as 3, 5 –the numbers are separated by a comma, without the quotes). This indicates 2 separate service areas.
We can also reset the properties of the network we built. In the
Travel Settings group, click the
iconNone
for the U-turns at Junctions. The rest of the dialogue
box should look like the figure below.
Now under the Output Geometry group, make sure that
Polygons
is checked. Select Standard Precision. This
results in faster analysis. Detailed polygons are much more accurate but
need more time to be generated.
Under Multiple Facilities Options, select Overlap
.
This creates individual polygons per facility that may or may not
overlap. Pay attention to the Dissolve and Split type. Dissolve merges
the polygons of multiple facilities that have the same cutoff values
into one polygon. Split creates individual polygons that are closest for
each facility.
Click Rings for the Overlap type. This excludes areas of smaller breaks from the polygons of a bigger break.
Run the Process to Compute the Service Area: Click the Run button on the Service Area tab. The service area polygons will appear on the map.
Map 2: Create a map layout depicting 3-minute and 5-minute service areas. Provide a short analysis of what you have just created – what are the benefits of creating service areas verses using the buffer tool. Note: we were able to create this because we had travel times for each road segment. This may not always be the case. You may have to rely on distances in some occasion.
Now we will determine which libraries fall within which service areas of Hospitals.
We will first create a spatial join between libraries and service areas.
Load the Library shapefile. Right-click the Library
layer and select Joins and Relates then Spatial Join…
Set “Service Area/Polygon” as the join feature. Select
within
as the Match Option so that the attributes of the
polygons (service areas) will be joined to the libraries that fall
inside the polygon. Should you use “Join one to many” or “one to one”?
It is up to you. Click OK.
Open attribute table for the newly added spatial join shapefile. Each row displays the name of the Library and Hospital service area it falls under.
The origin-destination (OD) cost matrix solver finds and measures the least-cost paths along the network from multiple origins to multiple destinations. The best path on the street network is discovered for each origin-destination pair, and the travel times and travel distances are stored as attributes of the output lines.
Now let us create an origin-destination cost matrix for the driving time between libraries and hospitals (for emergency planning). The results of this matrix can be used to identify libraries that will be serviced by each hospital within a 10-minute drive time.
Load the Library and Hospital shapefiles.
Click Network Analyst
on the Analyst tab and click
Origin-Destination Cost Matrix
The OD cost matrix analysis layer is added to the
Network Analyst
tab. The network analysis classes (Origins,
Destinations, Lines, Point Barriers, Line Barriers, and Polygon
Barriers) are empty. The analysis layer is also added to the
Contents pane
.
Go to the OD Cost Matrix, click Import
OriginsInput Network Analysis Layer
is set to
OD Cost Matrix
and Sub Layer
is set to
Origins
. Choose Library as the
Input Locations
. Leave the default settings for the rest of
the parameters and click the OK. The 31 new origins are displayed on the
map. Check the attribute table of the Origin Layer.
In the OD Cost Matrix tab, click
Destinations
Next, you will specify that your OD cost matrix will be calculated based on drive time. You will set a default cutoff value of 10 minutes and ensure that all destinations are found within the specified cutoff.
OD Cost Matrix
tab, in the
Travel Settings
group, ensure that
Driving Time
is selected for Mode
.Cutoff
text box, type 10.Straight Line
s in the
Output Geometry
section.Launch Travel Mode Properties
buttonTravel Settings
section. Allow for the
U-Turns, but put restrictions on Oneway and RestrictedTurns.Click the Run button. The OD lines appear on the map.
Open the attribute table of the Lines Layer. The Lines table represents the origin-destination cost matrix from each Library to the hospitals within a 10-minute drive time. The DestinationRank is a rank assigned to each destination that is served by a hospital based on the total drive time.
The OD cost matrix displays the libraries serviced by each hospital along with the total drive time for each route. Some libraries are within the 10-minute accessibility zone of more than one hospital and can be served by anyone of them.
Map 3: Create an origin-destination map and accompanying table for the relationship between libraries and hospitals. What is the most accessible hospital? (10 points)
In this part, you will choose the store locations that would generate the most business for a retail chain. The main objective is to locate stores close to population centers, which provide demand for the stores. This objective is based on the premise that people tend to shop more at nearby stores than at those that are farther away. You will perform the location-allocation analysis using three different problem types: maximize attendance, maximize market share, and target market share. The differences among these problem types will become apparent as you work through the exercise.
We will add several new shapefiles to our network map to conduct our analysis. From the data folder, add:
Creating the location-allocation analysis layer
Network Analysis
—>
Location-Allocation
.You will add the candidate stores’ locations to the network analysis class Facilities. The solution from the location-allocation process will include a subset of these stores. You will load the point features from Candidate Stores into the Facilities class of the location-allocation layer.
Input Network Analysis Layer
is set to
Location-Allocatio
n and Sub Layer
is set to
Facilities
. Select CandidateStores
from the
Input Locations
drop-down list.Field Mapping
, make sure the
Field Name
is set to NAME
.The 16 candidate stores load as facilities. These locations are drawn on the map with the candidate facility symbol.
The stores need to be located to best serve the existing populations. A point layer of census tract centroids is already added to the content pane. Now you will load these centroids into the demand points network analysis class.
Location-Allocation
tab, click
Import Demand Points
.TractCentroids
from the
Input Locations
drop-down list.Field Mappings
—> Property
, choose
Weight
. From the Field Name
drop-down list,
choose POP2000
.The 208 Tract Centroids load as demand and the population at each location is mapped to the weight property for the demand. These locations are drawn on the map with the demand symbol.
The Location-Allocation
tab includes a
Problem Type
section, where you can specify properties for
the locations.
Problem Type
group of the Location-Allocation
tab, click the arrow under
TypeMaximize Attendance
. Maximize attendance is a good problem
type for choosing retail store locations. It assumes that all stores are
equally attractive, and that people are likely to shop at nearby
stores.Travel Settings
group. This will choose 3 out of the 16
candidate stores to optimally serve the 208 demand points.Click the Run button on the Location-Allocation tab. Once the solve process is completed, lines in the map display connect chosen stores to their associated demand points.
Now you will inspect the results in more detail.
In the Contents pane, right-click the Facilities
sublayer and choose open attribute table. Examine the attributes of the
Facilities table. Three features have their FacilityType field values
set to “Chosen” instead of the default status—“Candidate”.
The DemandCount
column lists the number of demand points
assigned to each of the chosen facilities. Note that out of the 208
demand points, only 73 were allocated to the chosen facilities because
some of the points were farther than the five-minute cutoff. The
DemandWeight
column lists the demand that is allocated to
each facility. In this case, the value represents the number of people
that are likely to shop at the store. Close the Facilities table.
Open attribute table of the Demand Points
sublayer.
Examine the attributes of the Demand Points table. The Facility ID
column has a value of Weight
column contains the population count that was loaded
from the census tract feature class. The AllocatedWeight
column contains the amount of demand that was apportioned to the
associated facility. The amount of weight allocated is based on the
linear distance decay and the five-minute cutoff parameters you set.
Open the attribute table of Lines
sublayer. This table
contains one record for each demand point allocated to a facility. It
also lists the shortest path impedance between the two locations and the
weight captured by the facility.
Map 4: Create the above Location –Allocation map. Now adjust one of the parameters (eg impedance cutoff, facilities to choose, impedance transformation etc.). Compare and contrast any differences with previous set-up follow the paragraphs above.
Location-allocation can locate new stores to maximize market share in light of competing stores. The market share is computed using a gravity model, which assumes that demand points have a probability of visiting stores based on some properties of the store as well as the distance away from that store.
Open ArcGIS Pro and add tl_2013_us_state.shp and migration.csv (in Part 5 Data).
State code could be refereed to https://www.census.gov/geo/reference/ansi_statetables.html.
Migrants is the number of migrants from origin state to destination state. y_cor and x_cor show that x- and y- coordination (GCS).
Map 6: Create the map showing migration directions (use arrow). Also, use appropriate classification method to classify the number migrants. You can exclude observations, such as observations with large number of migrants.
Map 1: Create a map layout of your route with stops and barriers (15 points)
Map 2: Service Area map with analysis (15 points)
Map 3: Create an origin-destination map and accompanying table for the relationship between libraries and hospitals. Which one is the most accessible hospital? (15 points)
Map 4: Create the above Location –Allocation map. Now adjust one of the parameters (e.g. impedance cutoff, facilities to choose, impedance transformation etc.). Compare and contrast any differences with previous set-up follow the paragraphs above. (25 points)
Map 5: Create a map layout achieving a target market share. Include discussion (15 points)
Map 6: Create a map layout show the number of migrants from original state to destinations (15 points)
The END