Building a Topological Network from a Road Dataset | Using the TopologyBuilder

Kailin Opaleychuk
Kailin Opaleychuk
  • Updated

Introduction

Network topology is made from a network of nodes and lines that is maintained throughout an area. The vitality of topological networks relies on consistent and connective geometry. Topology is often applied to transportation datasets to ensure certain logic is being followed (i.e., for addressing over or underpasses on a highway). 

In this scenario, we are faced with a centrelines road.gdb (accessible here) of Surrey, BC. To create an accurate topological network, we will need to perform some geometric handling. When working with advanced topologies, you may choose to apply validation rules to produce a more sophisticated network. 

What is required before you can build a topological network?

  1. Lines must touch at an END vertex (snapped).
  2. Lines must be split at junctions. (i.e., junctions must be at the end of a line, not at an interior vertex).
  3. No complex edges present (FME doesn't support these).

To learn how to identify bad topology, please reference the examples in this tutorial: Data QA: Identifying Bad Topology in Linear Networks

Step-by-step Instructions

Download TopologyBuilderArticle.zip to follow along with this exercise from home. 

1. Start Workbench

Open Workbench and start a new workspace.

2. Add an Esri Geodatabase (File Geodb Open API) Reader

Leave all parameters as default. Click OK to add the reader to the canvas.

1.jpg

3. Add a Deaggregator

Use the transformer gallery or another method to add a Deaggregator. Leave all parameters as default. Connect it to the Esri Geodatabase reader. By deaggregating, we break multi-part lines into separate features each line feature for later operations.

2.jpg

4. Add a PathSplitter

Now we are going to create line segments by adding a PathSplitter. Leave all parameters as default. Connect the output port from the Deaggregator. 

Paths are sometimes used for complex edges. These are continuous edges that have path segments where other lines join at a junction (FME doesn't support complex edges). 

3.jpg

5. Run your workspace

Let's take a look at our transformation so far. Run your workspace with feature caching enabled and use the Visual Preview window to inspect the road data. Currently, we have been segmenting features to apply topology.

As we inspect the data, we notice some features are not aligned (i.e., vertices at a junction must be at exactly the same point/location). Please reference the bottom left image. The image on the right shows the expected alignment. So, how do we address this issue? 

We can also choose to view our data in the FME Data Inspector, which offers additional functionality, such as the measure tool, compared to the Data Preview window (user preference). You can access FME Data Inspector through the Start menu. Once initiated, select File > Open Dataset to view your file.

4.jpg
6. Add a Snapper
Add a Snapper to your workflow. We will be using Segment Snapping. To find the appropriate value for Snapping Distance, it's helpful to use the Measure tool in the FME Data Inspector. Set the Snapping Distance to 5.0 and Tolerance to Automatic.

5.jpg
 
7. Create a Workspace Junction
Junctions are a useful tool for managing connections as you build and organize a workspace. To make a Junction, right-click on the Snapped port on the Snapper and select Insert Junction. This way ,we can pass both snapped and unsnapped segments through our workspace. 

gif.gif
8. Add Two CoordinateExtractors
We will use two CoordinateExtractors to retrieve the first and last coordinates of each line feature. Add two CoordinateExtractors to the canvas and connect them both to the Junction.
6.jpg
Double-click on the first CoordinateExtractor to open the parameters. Here, we will find the first coordinate of each road. Set the Mode to Specify Coordinate. Expand the Specify Coordinates section of the transformer. Set Coordinate Index to 0, X Attribute to _x0, and Y Attribute to _y0. Click OK to confirm.

7.jpg
 
Now, we will repeat this process with CoordinateExtractor_2 to determine the last coordinate of each road. However, we need to specify different coordinate values. Set Coordinate Index to -1, X Attribute to _x1, and Y Attribute to _y1. Click OK to confirm.

8.jpg
9. Add Two VertexCreators
Add two VertexCreators to the canvas. We need to properly node the network without introducing new vertices (or end nodes). This is extremely important in road networks, as it avoids representing highway overpasses or bridges as intersections (for example). To accomplish this, we can utilize the coordinates extracted in the previous step. Each CoordinateExtractor will connect to an individual VertexCreator, like below:

9.jpg
Double-click on the first VertexCreator to open the parameters. Set Mode to Replace with Point, X Value to _x0, and Y value to _y0.

10.jpg
When you are done, repeat this process with VertexCreator_2 with the following values, set Mode to Replace with Point, X Value to _x1, and Y Value to _y1.

11.jpg
10. Add a PointOnLineOverlayer
In this step, we will use a PointOnLineOverlayer to create road junctions and split lines at these junctions. Add a PointOnLineOverlayer to the canvas. Connect both VertexCreator outputs to the Point input port on the PointOnLineOverlayer. Next, connect the Junction (after Snapper) to the Line input port. Open the parameters, apply a Point Tolerance of 0.1, and leave all other parameters as default.

19.jpg

12.jpg
11. Build the Topology
Add a TopologyBuilder. Connect the Line output port to the TopologyBuilder. Leave all parameters as default.
*Note: List generation is optional. If you do not wish to generate lists for Edges or Nodes, leave the boxes unchecked.

13.jpg

12. Add an Esri Geodatabase (File Geodb Open API) Writer
Finally, let's write the results. Add an Esri Geodatabase (File Geodb Open API) writer. Select a file destination for your dataset. Set Coord. System to LL84. Open the parameters, and change Overwrite Existing Geodatabase to Yes. Leave the default parameters. Connect the Edge output port from the TopologyBuilder to the Esri Geodatabase writer feature type. Click OK. Run your workspace.

As of FME 2025.2, the Coordinate System parameter is now configured within the Parameters dialog of each reader/writer format. For more information, including details about the change and affected transformers, please see Coordinate System Parameter Location Change.


14.jpg

You have now created a topological network for road centerlines in Surrey, BC. The final workspace should look similar to below: 

15.jpg

Use FME Data Inspector or the Visual Preview Window to inspect your results. 

17.jpg
 

Data Attribution

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

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.