Creating Lines from Points

Evie Lapalme
Evie Lapalme
  • Updated

FME Version

  • FME 2022.0

Introduction

The LineBuilder connects input point features in the order they enter, forming linear or polygonal features. The output features from the default parameters will contain a merged set of attributes from all the features that were connected together, where the value for an attribute in the resulting feature comes from the first feature that had an attribute with that name that was part of the resulting feature. This can be changed based on the accumulation mode, such as generating a list of attributes if needed as well. In this tutorial, we will be walking through how to take points and turn them into lines with the LineBuilder transformer.

 

Step-By-Step Instructions

Part 1: Default Parameters

1. Open FME Workbench
Open FME Workbench and click New to create a new workspace.

2. Add the Data to the Canvas
Add the “points.ffs” to the canvas by downloading the file from the Files section and dragging the file onto the canvas. Click OK. 

3. Add the LineBuilder
Add the LineBuilder by typing to bring up the list of FME Transformers in the Quick Add Search. Select the LineBuilder from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it to the canvas. Leave all parameters as defaults. Connect this transformer to the Points reader feature type.

Order is important for the line creation as it is built in the order that the point features arrive at the LineBuilder transformer. To remedy this, you may want to use a Sorter to order the data correctly before it enters this transformer. 

4. Run Workspace
Run the workspace with Feature Caching enabled to view the output in the Visual Preview window. The workspace should look like this:

image.png

Input:
image.png
Output:
image.png

 

Part 2: Group-By Method

1. Open FME Workbench
Open FME Workbench and click New to create a new workspace.

2. Add the Data to the Canvas
Add the “points.ffs” to the canvas by downloading the file from the Files section and dragging the file onto the canvas. Click OK. 

3. Add the LineBuilder
Add the LineBuilder by typing to bring up the list of FME Transformers in the Quick Add Search. Select the LineBuilder from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it to the canvas. Check the Group By checkbox and select the “GroupBy” attribute. Leave the rest of the parameters as defaults. Connect this transformer to the Points reader feature type.

image.png

Order is important for the line creation as it is built in the order that the point features arrive at the LineBuilder transformer. To remedy this, you may want to use a Sorter to order the data correctly before it enters this transformer. 

4. Run Workspace
Run the workspace with Feature Caching turned on to view the output in the visual preview. 

Input:
image.png

Output:
image.png

 

Data Attribution

Data used in this tutorial originates from data made at Safe Software. 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.