Using Label Manager

Each map layer appears in the Label Manager as a separate row in a grid.  For each map layer, a user can configure a label definition by clicking the Style button and configure a placement rule by clicking the Rule button.  The order in which labels are placed is controlled by the Priority column.  Labels in map layers with a smaller number for Priority are placed before other labels in map layers with a higher number for Priority.  Whether a label should be generated and placed for a map layer is controlled by the checkbox in the Label column.  Whether the features in a map layer are to be seen by the labeling engine as obstacles to be avoided is controlled by the checkbox in the Obstacle column.  Which placement rule is used to place labels in a map layer is controlled by the pulldown in the Rule column.  Since map layers in FME may contain multiple feature types and because Labeller only supports the ability to label only those features in the map layer of one feature type, the user must choose in the Feat Type column the type of feature for which to generate labels by clicking on the icon pulldown and choosing the desired feature type to label.

Defining a label definition involves configuring its style as shown below.

The content of the label is defined by a Text expression that can either be a string constant in double quotes or an arrangement of the map layer’s attributes using binary operators and functions.  The appearance of the label is configured with Font family, Font Style, Size in points, and Color.  An optional Symbol can be included that would build a label with the Symbol as the base and the text content placed inside the Symbol.

The Expression dialog shown below enables the user to build the content from a set of attributes, operators, and functions:

The feature type chosen for a map layer determines which placement rule palette is shown when the Rule button is clicked.  To configure a placement rule for a map layer, either select the rule from the map layer’s rule pull-down that is to be used to place labels in that layer or click the Rule button to configure a new rule.

All placement rules share a set of persistence capabilities in which the user can choose which placement constraints to relax in order to achieve a successful placement when initially placing the label under these constraints fails.  Examples of these capabilities include dividing a label into multiple lines of text when placing the label in a single line of text fails, reducing the font size of the label when placing the label at the size specified in the Style dialog fails, allowing a label to cross some lines or area boundaries when avoiding these as obstacles fails to place the label, etc.  The order in which these attempts to place the label are tried is hardcoded into the Labeller.

Point Placement Rule

A point feature rule palette looks as follows:

This rule palette instructs the labeling engine to first place the label at the chosen locations around or on the point location in the order in which the user has configured them to be tried.  If a tried position fails (with some flexibility in moving around in that location) to lead to an overlap free position, the next position is tried until all configured positions are exhausted.  The angle at which these positions are tried is controlled by the ‘Place label at angle’ property.  The label’s offset from the point location (or point symbol shape) is controlled with the ‘Distance from Feature’s Initial Attempt property.  The ‘Retry Up To’ property gives the labeling engine the permission to move the label farther from the point location up to the amount specified.

The Justification property enables the user to specify how a multiple line label should be justified when the ‘Allow Stacking’ property is invoked. 

The Allow Font Reduction capability instructs the labeling engine to retry placement, but with the font size of the label reduced by a single font step of .5pt.  Subsequent steps are tried until the number of specified reductions is exhausted.

The Allow Labels to Cross Lines capability instructs the labeling engine to allow the label to cross either all lines and area boundaries or only the selected ones if initially avoiding placing the label on a line or area boundary failed to lead to a successful placement.

The Allow Overlapping Labels capability instructs the labeling engine to allow the label to be placed on other labels in order to ensure that this label is placed on the map.

The Allow Use of Leader Lines capability instructs the labeling engine to try placing the label some distance from the point feature and drawing a leader line from the label to the feature.  This placed leader line is part of the set of objects emitted on the <map layer>_TXT output port.

Line Placement Rule

A line feature rule palette looks as follows:

This rule palette instructs the labeling engine to first place the label at the Center, Start, or End of the feature.  If obstacles are detected in those locations, then the labeling engine will move the label along the line feature searching for an overlap free location.

The user can specify the orientation of the label relative to the line feature by requesting that the label be placed Conforming to the shape of the line feature, Horizontal to the line feature, Tangent to the line feature, or Perpendicular to the line feature.

The user can specify whether the label should be placed on the line feature or offset from it.  If offsetting is desired, the user can instruct the labeling engine to try placing the label Above the line, Below the line, and/or split the label into two lines and put the first line above the line feature and the second line below the line feature (Vertical Split).

Line features in the same map layer that share the same label and are geometrically connected to each other can be labeled as a single joined line feature using the ‘Label Joined Feature’ option, or each individual line feature can be labeled using the ‘Label Each Feature’ option.

In some datasets, two line features in the same map layer that are approximately geometrically parallel may also share the same label.  In this situation, you may not want to label both of these line features with the same label and instead instruct the labeling engine to choose one of the line features and label that one only.  An example of this might be a highway represented as two distinct line features.  Checking the Divided Highways checkbox tells the labeling engine to detect these situations.

One of the persistence capabilities specific to line features is enabling the labeling engine to divide the label into two lines only and placing the two-line label either above the line, below the line, or on the line depending on which placement option was chosen.  This capability is enabled by checking the Stacking checkbox.

Some applications demand that the words of a label be spread apart. One can instruct the labeling engine to perform this by checking the Spread Words checkbox and specifying the desired spacing between words.

To place more than one instance of a label along a long line feature, check the Repeat Labels checkbox, and specify the maximum spacing between instances. 

For short line features, the label’s length may not fit within the boundaries of the line.  In this case, this line feature specific persistence capability enables the user to relax this constraint and allow the label to “hang” off the edge of a line feature at either its beginning or end if this is necessary to place the label successfully.

The remaining persistence capabilities are common to a point placement rule and are described there.

Area Placement Rule

An area feature rule palette looks as follows:

This rule palette instructs the labeling engine to either place the label horizontally and wholly inside the area feature (Place Horizontal), at the dominant angle of the area feature and wholly inside (Place at Dominant Angle), horizontally and allowed to be partially inside the area feature and partially outside (Place Extending Beyond Boundary), wholly outside of the area feature as if it were a point symbol (Place Outside), and inside the area feature along its boundary as if it were a line feature (Place Inside Along Boundary).

The remaining persistence capabilities are common to a point placement rule and are described there.