Files
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 involving 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.
1. Add an Autodesk AutoCAD DWG/DXF Reader
Open FME Workbench and create a new workspace. Add a reader to the canvas. In the Add Reader dialog:
- Format: Autodesk AutoCAD DWG/DWF
- Dataset: \CompleteRoads.dwg
- Workflow Options: Single Merged Feature Type
-
Parameters:
-
Group Entities By: Attribute Schema
- Click on Parameters to open the dialog
-
Group Entities By: Attribute Schema
2. Add OGC GML (Geography Markup Language) Reader
Add another reader to the canvas, in the dialog:
- Format: OGC GML (Geography Markup Language)
- Dataset: \FireHallsWithZones.gml
- Workflow Options: Individual Feature Types
In the Select Feature Type dialog, select:
- FireHalls
- MedicZones
3. Select Firehall #4
We only want to create the isolines from Firehall #4. Add a Tester transformer to the canvas and connect it to the FireHalls reader feature type. In the parameters:
- Left Value: HallNumber
- Operator: =
- Right Value: 4
4. 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.
In the parameters,
- Output Optimal Cost As: Z-Values
- Snap Source Points: Yes
- Snapping Tolerance: 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.
5. Visualize Network Costs
Add a ContourGenerator to the canvas and connect the Breaklines input port to the Connected output port on the NetworkCostCalculator.
In the parameters,
- Surface Tolerance: 10
- Output Contour Interval: 50
6. Inspect Contours
Run the workspace with Feature Caching Enabled, then view the Contours output on the ContourGenerator.
After running the workspace, in Data Preview, we will get a set of Isodistance lines showing the distance (by road) from Firehall #4.
7. 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.
In the parameters,
-
Output Attribute Name:
- Result: TravelTime
-
Arithmetic Expression:
@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))
8. Change Weight Type
Next, we need to change the NetworkCostCalculator to accept the new TravelTime attribute. Open the NetworkCostCalculator parameters, and change:
- Weight Type: By Two Attributes
- Forward Weight Attribute: TravelTime
-
Reverse Weight Attribute: TravelTime
9. Change Surface Tolerance
Open the ContourGenerator parameters. Change the following:
- Surface Tolerance: 1
- Output Contour Interval: 0.5.
Each contour will represent 0.5 minutes or 30 seconds of travel time.
10. 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.
11. Select Firehall #4 Medic Zone
We only need the MedicZone that relates to Firehall#4. Duplicate the first Tester, then connect Tester_2 to the MedicZones reader feature type.
12. 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.
13. Run Workspace
Now run the workspace again and inspect the Inside port on the Clipper. 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.
Advanced Exercise
Now we'd like to set the speed for each road type.
1. Add an AttributeValueMapper
Add an AttributeValueMapper in between the <All> reader feature type and the ExpressionEvaluator. In the parameters,
- Input Attribute: fme_feature_type
- Output Attribute: Road Speed
- Default Output Value: 30
| Input value | Output Value |
|---|---|
| Arterial | 60 |
| Collector | 55 |
| Secondary | 50 |
| Residential | 35 |
2. Update Expression
Open the ExpressionEvaluator parameters, update the expression to use RoadSpeed:
@Length()/(@Value(RoadSpeed)*16.666666666)
3. Run Workspace
Run the workspace once more and view the output in Data Preview.
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.