Label Group
The built-in functions in this group have been added to support the automated placement of labels for features by a third party tool. The functions are designed to produce point or line geometries that can be used to position the text.
Centre_for_Label
This function finds a centre point for an are, which is guaranteed to lie within the area. In addition, the function tries to find a location which is as far as possible from the outline of the are, and still close to the natural centroid. The centre point is calculated to provide the best position where to centre a horizontal label within the input geometry.
- Parameter 1 (Geometry): The input of simple or complex area geometry.
- Parameter 2 optional (Double): Ration between the length and the height of the label. A value of 10 would mean that the label is ten times longer than it is tall.
- Return Value (Geometry): A simple point representing where the centre of the label should be positioned.
The following figure shows the results obtained by this function for a number of water areas.
Centre_for_label function
Centreline
This function returns a centreline for a specified simple area and it ends on the outline of the input area.
Note: The Centreline is used for labelling, meaning the middle part of the line is used, rather than the ends.
- Parameter 1 (Geometry): A simple area to compute a centreline.
- Return value (Geometry): A simple line representing the centreline of the input area.
Note: The function will need to have several branches when working with complex shapes.
The figure shows the results obtained for some simple areas.
Obtained Centrelines
Midpoint
This function returns the middle point of a simple line.
- Parameter 1 (Geometry): Input simple line.
- Return Value (Geometry): The point in the middle of the input line.