Map and Map Feature Annotation

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

Although FME can create cartographic elements, such as labels, it is not intended for cartographic use. In this tutorial, you will learn how to create labels for point features and how to create a center point in polygons, which can then be converted to a label point.

Data Source

Source

The source for part 1 is an Esri Shapefile containing point locations for schools in the City of Vancouver.

Input1.png

The source for part 2 is an Esri Geodatabase containing neighborhood polygons for the City of Vancouver.

Input2.png

Step-by-step Instructions

Exercise 1: Labeling Point Features

In this scenario, you want to create labels for school point features.

1. Create a New Workspace

Open FME Workbench and create a blank workspace.

NewWorkspace.png

2. Add an Esri Shapefile Reader

Add an Esri Shapefile 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 Esri Shapefile as the Format, then for Dataset, browse to the Schools.shp dataset, which is available for download from the Files section on this article.

Reader1.png

3. Label Points

Click on the Schools reader feature type to select it. Then add a LabelPointReplacer transformer to the canvas by typing “LabelPointReplacer” to bring up the list of FME Transformers in the Quick Add Search. Select the LabelPointReplacer from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it.

Quickadd1.png

Connection1.png

Double-click on the LabelPointReplacer to open the parameters. In the parameters, set the Label to school_name, then set the Label Height to 50.

LPR1.png

Note: Label height is measured in ground units (meters in this case) and may be entered as a number or taken from the value of a feature attribute by selecting the attribute name from the drop-down list. If the label height is too tall, you can either adjust the label height accordingly in the LabelPointReplacer parameters or edit the annotation size in the output format.

4. Run Workspace

Add an Inspector to the canvas and connect it to the LabelPointReplacer LabelPoint output port.

Workspace1.png

Run the workspace by clicking the Run button on the top toolbar, or by selecting Run > Run Workspace from the top menu bar.

Run.png

After running the workspace, in the Visual Preview, labels will appear next to each point feature.

output.png

Exercise 2: Labelling Polygon Features

In this scenario, you want to create labels for neighborhood polygon features that can be exported.

1. Create a New Workspace

Open FME Workbench and create a blank workspace.

NewWorkspace.png

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

Add an Esri Geodatabase (Open API Geodb) 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 Esri Geodatabase (Open API Geodb) as the Format, then for Dataset, browse to the Neighborhoods.gdb dataset, which is available for download from the Files section of this article.

Reader2.png

3. Find Center Point

Before we can label the neighborhood polygon, we need to define a location to attach the label; in this case, the polygon's center point. Click on the Neighborhoods reader feature type to select it. Then add a CenterPointExtractor transformer to the canvas by typing “CenterPointExtractor” to bring up the list of FME Transformers in the Quick Add Search. Select the LabelPointReplacer from the list of Transformers by double-clicking or by using the arrow keys and the Enter key to add it. There are no parameters to set.

Quickadd2.png

Connection2.png

4. Label Points

With the center points defined, a label can be attached. Add a LabelPointReplacer to the canvas and connect it to the CenterPointReplacer. In the parameters, set the Label to NeighborhoodName, then set the Label Height to 200.

LPR2.png

Label height is measured in ground units (meters in this case) and may be entered as a number or taken from a feature attribute by selecting the attribute name from the drop-down list. If the label height is too tall, you can either adjust the label height accordingly in the LabelPointReplacer parameters or edit the annotation size in the output format.

5. Run Workspace

Add an Inspector to the canvas and connect it to the LabelPointReplacer LabelPoint output port.

Workspace2.png

Run the workspace by clicking the Run button on the top toolbar, or by selecting Run > Run Workspace from the top menu bar.

Run.png

After running the workspace, in Data Preview (formerly Visual Preview), labels will appear next to each point feature in the center of each neighborhood polygon.

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?

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.