Creating Time and Distance Isolines using the NetworkCostCalculator

Liz Sanderson
Liz Sanderson

FME Version

Introduction

Isolines are lines depicting constant values; for example, a contour is an isoline that depicts a line of constant elevation.
Isodistances and isochrones are a form of isolines. Isodistances depict a line of equal distance from an origin point, and isochrones depict a line of equal time. In many cases, they are used to depict travel distances and travel times.
FME is capable of creating isodistances and isochrones using the NetworkCostCalculator transformer combined with the ContourGenerator transformer.
 

Video

This video was filmed using an older version of FME. The user interface may be different, but the concepts are the same. 
 

Step-By-Step Instructions

The scenario here is that we wish to calculate travel times for a particular firehall, to ensure that all properties within the area of responsibility can be provided with emergency medical coverage within a 4-minute time period.
As with most FME translations, only part of the authoring process involves calculating the travel times, with the remainder of the process involves setting up the source datasets correctly.
 

Source Data

The first source dataset for this example is a set of road features (in an AutoCAD DWG dataset) representing the road network available for travel.

The second dataset (in GML format) is a collection of firehalls and their area of responsibility.

gis-networks-iso-workspace0.png

1. Create a New Workspace
Open FME Workbench and create a blank workspace. 
NewWorkspace.png
 
2. Add an Autodesk AutoCAD DWG/DXF Reader
Add an Autodesk AutoCAD DWG/DXF reader to the canvas by clicking on the Reader button on the top menu bar or by going to Readers > Add Reader. In the Add Reader dialog, select Autodesk AutoCAD DWG/DXF as the Format, then for Dataset, browse to the CompleteRoads.dwg dataset, which is available for download from the Files section on this article. Change the Workflow Options to Single Merged Feature Type, then open the Parameters.
Roadsreader.png
 
In the parameters, change Group Entities By to Attribute Schema, then click OK twice to finish adding the reader. Group Entities By Attribute Schema exposes the DWG attributes. In the Select Feature Type Dialog, ensure all feature types are selected then click OK. 
ReaderParams.png

In the Select Feature Type dialog, ensure that all of the Layers are selected, then click OK. 
SelectFT.png
 
3. Add OGC GML (Geography Markup Language) Reader
Next, add an OGC GML (Geography Markup Language) reader to the canvas and browse to the FireHalls.gml dataset. Before clicking OK to add the reader, change the Workflow Options back to Individual Feature Types. 
FireHalls.png

In the Select Feature Type dialog, select only the FireHalls and MedicZones feature types, then click OK.  
SelectFT.png
 
4. Select Firehall #4
We only want to create the isolines from Firehall #4. Click on the FireHalls reader feature type to select it.  Then add a Tester transformer to the canvas by typing “Tester” to bring up the list of FME Transformers in the Quick Add Search. Select the Tester from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it. 
QuickAdd.png
TesterConnect.png

 
Double-click on the Tester to open the parameters. In the parameters set the Left Value to Name, then set the Operator to Ends With. Finally set the Right Value to 4. 
Tester.png
 
5. Calculate Network Cost
Next, add a NetworkCostCalculator to the canvas and connect the Line input port to the <All> reader feature type, and then connect the Source input port to the Tester Passed output port. 
NetworkCost.png
 
In the parameters, set the Output Optimal Cost As to Z-Values. Next, set the Snap Source Points to Yes, and set a Snapping Tolerance of 100. 
These parameters will output the costs as Z values on each network line and will snap the source firehall to the network if it doesn't sit exactly upon it.
NetworkCostCalcu.png
 
6. Visualize Network Costs
Add a ContourGenerator to the canvas and connect the Breaklines input port to the Connected output port on the NetworkCostCalculator. 
 ContourConnect.png

In the parameters, set the Surface Tolerance to 10, and the Output Contour Interval to 50. 
ContourGen2.png 

7. Inspect Contours
Add an Inspector to the canvas and connect it to the Contours output port. 
 Inspector.png

Run the workspace by clicking on the Run button on the top toolbar, or by using Run > Run Workspace on the top menu bar. 
Run.png
 
After running the workspace, in Visual Preview, we will get a set of Isodistance lines showing the distance (by road) from Firehall #4.
Inspect1.png
 
8. Create Isochrones 
To create Isochrones (lines of equal travel time) we need to specify the speed at which a vehicle can travel. Obviously, this varies depending on the type of road, terrain, weather, and intersection crossings; but a quick search shows that the average speed of a fire truck in a city is 55kph (35mph).
Add an ExpressionEvaluator to the canvas between the <All> reader feature type and the NetworkCostCalculator. 
ExpressionConnect.png
 
In the parameters, set the Output Attribute Name to TravelTime. Then set the Arithmetic Expression to:

@Length()/916.666666

@Length() is an FME function that measures the length of each road link. 916.66666 comes from (speed * (meters-per-km / seconds-per-minute)) which is (55*(1000/60))
ExpressionEval.png
 
9. Change Weight Type
Next, we need to change the NetworkCostCalculator to accept the new TravelTime attribute. Open the NetworkCostCalculator parameters, and change Weight Type to By Two Attributes. Then set both Forward and Reverse Weight Attributes to TravelTime. 
NetworkCost2.png
 
10. Change Surface Tolerance
Open the ContourGenerator parameters. Change the Surface Tolerance to  1 and the Output Contour Interval to 0.5. Each contour will represent 0.5 minutes or 30 seconds of travel time. 
ContourGen2.png
 
11. Rerun Workspace
Rerun the workspace and view the result in Visual Preview. The result will be a series of isochrones representing travel times for emergency vehicles in the city of Vancouver. 
Inspect2.png
 
12. Select Firehall #4 Medic Zone
We only need the MedicZone that relates to Firehall#4. To do this, duplicate the existing Tester (ctrl+d/cmd+d) and connect it to the MedicZone reader feature type. 
Testers.png
 
13. Clip to Firehall’s Service Area
To determine whether all parts of this firehall's area of responsibility are covered by the four-minute limit, we'll need to clip the results to that boundary. Add a Clipper transformer to the canvas and connect the Clipper input port to the Tester_2 Passed output port. Then connect the Candidate input port to the ContourGenerator Contours output port. 
ClipperConnect1.png

The Clipper and Candidate connection lines will be crossed. To uncross them, right-click on the Clipper port and select Move Down. 
MoveDown.png
 
14. Run Workspace
Add an Inspector to the Clipper Inside output port and connect the same Inspector to the Tester_2 Passed output port. 
Workspace3.png

Now run the workspace again. With this result, we can see that there are no parts of this hall's area of responsibility that fall outside of the four-minute travel limit. 
Output.png

 

Additional Project Ideas

Further updates to this project, should you wish to try them, would be to:

  • Set a different average travel speed for each road type; for example, arterial roads could be 60kph, whereas residential roads are 40kph. See attached template for an example of this. Notice how it changes the results so that some areas do fall outside the four-minute limit.

  • Do as in this example, where each block of properties is color-coded depending on the amount of time required to travel to it.
  • Write the processed road network (the output from the NetworkCostCalculator) to a dataset using a fanout so that each layer of data represents the road extents that could be traveled with an additional minute of travel time.
  • Create a model including ALL points (for example all firehalls). It's more complex because it needs a group-by in the NetworkCostCalculator, but it is possible.

 

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

Comments

1 comment

  • Comment author
    Amin Sule

    Hi Liz,

    thank you for this article.  :)

    In the first bullet point of the Additional Project Ideas, you mention 

    • Set a different average travel speed for each road type; for example, arterial roads could be 60kph, whereas residential roads are 40kph. See attached template for an example of this. Notice how it changes the results so that some areas do fall outside the four-minute limit.

    I downloaded the TimeAndDistanceIsolines workspace attached to this article but couldn't see an example of this. Would you be able to provide screenshots of where you configured the different road types.

    Many thanks :) 

    0

Please sign in to leave a comment.