gvSIG-Desktop 1.12. Manual de usuario
Advanced Labelling (user defined)
Introduction
User defined labelling provides the user with a great degree of control over the design and placement of labels. It has many more options and is much more powerful than static labelling.
The three different methods of user defined labelling are described below.
Label features in the same way
Choose this option to apply the same label style to all features in the layer, regardless of whether they have been selected or not.
The interface for this labelling option looks like this:
Note the following options, which are explained below:
- Properties
- Visualization
- Placement
It is also possible to preview the labels that have been defined for the layer. These will be applied to the View if the Apply or Accept buttons are clicked.
Label only when the feature is selected
Apply the label setting only to those features that are selected in the View.
This labelling is dynamic, so that if the selection in the View is changed, the View is automatically updated with the labels for the new selection.
The interface for this labelling option is the same as that shown above (Label features in the same way).
Define classes of features and label each differently
With this option the user can create different label classes (through the 'Add' button), assign them a priority for display (using the 'Move up' / 'Move down' buttons to the right of the panel) and label each one separately.
The properties for each class can be accessed by double clicking on the relevant class (This brings up a dialog box, which is the same as for the three existing advanced labelling methods).
In other words, the label classes can be configured separately, with different labelling properties and different filters applied to the layer geometry for each class. Keep in mind that the labelling expression uses SLD grammar, while the geometry filter is applied using SQL statements, as defined by GDBMS.
The dialog box below shows how SQL statements can be entered for each of the label classes. These statements act as filters that determine which of the layer's features the class is applied to.
Here is an example of how this SQL filter is used:
Common options
Introduction
Regardless of which advanced labelling method is chosen, there are some options that are common to all three methods. These options provide a great degree of control over the configuration of the labels.
These options are accessible via the buttons on the labelling tab of the Layer properties dialog box and are described below.
Properties
The 'Properties' button provides access to a large number of label options.
Clicking this button opens the dialog box shown in the figure below:
The following properties can be set in this dialog box:
Name
Font type
Font colour
Text size (fixed size or adjusted to fit on text area)
Label expression (one or more)
This is where the actual label is specified. The possibilities are:
- Strings (enclosed in quotes)
- Fields from the attribute table (enclosed in square brackets)
- Mathematical expressions
- Combinations of the above
Label all features / filter features with a SQL statement
The SQL filter allows the user to apply the defined label to certain features only.
Background style
Select a style (picture) as a background for the labels. Clicking the 'Select' button opens the following dialog box:
When gvSIG is installed, the installer automatically creates a directory called 'Styles' in the directory /user/gvSIG/. This is where all the label styles are saved (by clicking the 'Save' button).
Once a label style has been selected, it is possible to modify its properties by clicking the 'Properties' button. This opens a dialog box (shown below) where the user can insert one or more text boxes in which to place the different label expressions that have been created. These text boxes can also be moved or deleted and it is also possible to upload a new image from disk.
Note: It is not possible to apply a background style if the label orientation is set to "Following the line" (see the Placement section below).
Placement
Clicking the Placement button opens the Placement properties dialog box where the following properties can be configured: location, orientation, duplicates, etc. The options available in this dialog box will depend on the geometry of the layer in question (point, line or polygon):
Point layer
If the layer is a point layer, the following options can be configured:
- Point settings
This options allows the user to place the labels on top of the points, or else to offset them around the points.
In the latter case, the label position can be selected from pre-defined placement configurations, which are accessed by clicking the Change location button. This opens the Placement priorities selector from where existing placement styles can be selected. It is also possible to modify a placement style by highlighting it and clicking the Properties button:
By using the tools on the right and applying them to the location grid on the left it is possible to set the label position priority relative to the point:
1 = High precedence
2 = Normal precedence
3 = Low precedence
0 = Prohibited
- Duplicate labels
Here it is possible to choose between 'Remove duplicate labels' (eliminate any duplicate labels and only draw one label per feature), 'Place one label per feature', and 'Place one label per feature part' (in the case of multipoint features).
Line layer
For line layers the following options are available:
- Orientation
The label can be oriented horizontally, parallel or perpendicular to the line, or can be set to follow the line.
- Position
The label can be placed above, on or below the line.
- Location
Place the label at the beginning, middle or end of the line, or at the best position.
- Duplicate labels
The options here are the same as for point layers (described above).
Polygon layer
If the layer is a polygon layer, the Placement properties dialog box provides the following options:
- Polygon settings
Labels can be set to be always horizontal, or else to follow the orientation of the polygons (always straight). There is also an option for fitting the labels inside the polygons. This last option is used to ensure that labels are placed inside polygons even if they have islands, or are U-shaped.
- Duplicate labels
These options are the same as for point and line layers.
Multigeometry layers
In the case of multigeometry layers (dwg, dxf, gml...) the Placement properties dialog box contains a tab for each of the three geometries (points, lines, polygons). These tabs are identical to those shown above.
Visualisation
Clicking the 'Visualisation' button opens a dialog box which allows configuration of the range of scales at which labels will be shown.
The user can choose to use the same scale range as the feature layer (set under the General tab of the layer properties dialog), or else can specify a scale range at which the labels will be visible (this scale range is independent of the range applied to the geometries of the layer).
In the example shown above, labels in the view are only displayed between the scales of 1:500000 and 1:1000000.
Allow label overlapping
Finally, there is a check box that controls whether labels may overlap or not.
If this box is checked then all labels are drawn, even if they overlap each other. If this box is left unchecked, only non-overlapping labels are drawn and all overlapping labels are eliminated.