Build Road Lines from GPS Points (CSV to Esri Shapefile)

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

In this translation, we will take some tabular CSV data, representing points along a road, connect the points to create lines, join some attribute data to the lines from an access file, and write the roads out to an Esri Shapefile.

Let's take a closer look at our source data. Many users work with spatial data in a delimited text format of some form, such as a CSV file, as we have in this example.

This file contains GPS points representing surveyed roads; each record holds a road ID value, vertex number and XY coordinates for each point. The road ID is a unique identifier for each road so, these 12 records with Road ID equals 1, represent one road. We also have some road attributes in an Access file. Notice that there is also a road ID column in this table; we will use this key attribute to join these road attributes onto our lines during the translation.

View of the GPS point data in a CSV file

Video

Note: This video was created using FME 2015; the concepts are similar, but the user interface may differ. In this demo, we'll set up a workflow to automatically import a CSV file of GPS data, convert it to GIS points and lines, join it with a Microsoft Access file to obtain further attribute data, and then write it out to an Esri Shapefile. You'll learn how to control the output schema and refine the attributes.

Step-by-step Instructions

1. Add Reader

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.

  • In a new workspace, click the Add Reader icon in the Toolbar and add a reader with the following parameters:

      • Format: CSV (Comma Separated Value)

      • Dataset: /major_roads.csv


    Click the Parameters button to set the coordinate system:

      • Attribute Definition: Manual


      • Name: x

      • Type: x_coordinate


      • Name: y

      • Type: y_coordinate


      • Create Point Geometry from Attributes: Enabled

      • Coordinate System: TX83-CF

    ReaderCSV2025.2


    Click OK to add the reader to the workspace.

  • In a new workspace, click the Add Reader icon in the Toolbar and add a reader with the following parameters:

      • Format: CSV (Comma Separated Value)

      • Dataset: /major_roads.csv

      • Coordinate System: TX83-CF


    Click the Parameters button and confirm that the x and y attributes are set to x_coordinate and y_coordinate, respectively. If they are not, change the Attribute Definition to Manual, then manually set.

    ReaderCSV2025.1


    Click OK to add the reader to the workspace.

2. Create Points with the VertexCreator

Add a VertexCreator to the canvas. In the parameters, set the X Value to x and the Y Value to y. Ensure that the Mode is set to Add Point.

3. Create Lines with the LineBuilder

Place a LineBuilder transformer on the canvas; if we just ran the workspace without setting any LineBuilder parameters, we would get one messy-looking line. We need to set the connection break attribute. Remember that the road ID is what uniquely represents each road; set this as the connection break attribute.

4. Join the data to an MS Access file containing attribute details

Now let's read in the roads_attrs.mdb MS Access file containing road attributes using the DatabseJoiner transformer, connect the DatabaseJoiner to the Lines Output port on the LineBuilder. In the parameters, read in the MS Access file and set the table to major_roads. Then for Feature Attribute set it to the road_id attribute and set the Table Field to ROAD_ID. For Fields to Add, click on the ellipsis, then select all of the features. The rest of the default values are good, click ok.

5. Write to Shapefile

Let's add a Shapefile writer, and then select automatic… for the definition. Browse to a folder to save the Shapefile to, then click ok. In the next dialog, enter Roads for the Shapefile Name, and set the Geometry to shape_polyline. Click ok and connect it to the Joined Output port on the DatabaseJoiner.

6. Clean up Attributes and Run Translation

As soon as we connect it up with the DatabaseJoiner, notice that the attributes are automatically populated based on what the destination feature type is connected to. Now, we really just want to see the attribute from the MS Access file in our final output so let's clean up the destination attributes. Double-click on the Shapefile writer to open the Destination Feature Type Properties and in the User Attributes tab click on Manual for the attribute definition; this allows us to edit the schema. Remove road_id, vertex_num, x and y; these came from the CSV file. Run the workspace and view the output.

Data Attribution

Data provided by the City of Austin and Travis County, Texas

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.