-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QEP 62: Curved labels improvements #62
Comments
@dakcarto Any comments on this QEP ? |
Small updates to the text and illustrations. |
@mhugo Sorry - I really thought I'd replied to this weeks ago! Anyway, +1 to both proposals. One follow up question (non-blocking):
|
@nyalldawson no problem and thanks for your feedback ! :) |
@mhugo - about the label anchor point. I wonder if this could event be taken one step further - that the labeling algorithm could analyze the line geometry and find out long-enough sections in the line string with minimal curvature - so that the user doesn't have to manually propose the anchor points, but the algorithm would do that. The user could still overwrite the positions if he wants to take full control on the anchor points. |
@andreasneumann That may be an nice option to have, indeed. I'll add it to the text, thanks |
a related improvement to curved labels and any line labeling option would be to allow to label lines from start or endpoint. See https://issues.qgis.org/issues/20847. It seems definitly doable according to @nyalldawson 's insights. |
Can't seem to move a curved line label without it becoming aligned as a horizontal line. Of course I can then rotate it but how due I get it formatted as a curved label in the new position? What am I missing? |
|
Label anchoring helps the label position however in 3.18 implementation it considers the visible portion of the line, and not the entire line. |
QGIS Enhancement 62 (was 41): Curved labels improvements
Date 2016/06/01
Author Hugo Mercier (@mhugo)
Contact hugo dot mercier at oslandia dot com
maintainer @mhugo
Version QGIS 3.0
Summary
This QEP describes some improvements to the labeling engine for a better handling of curved labels.
A new option allowing to manually place these curved labels is proposed as well as a support for multiline curved labels.
Label anchor point
The labeling engine of QGIS allows to ask for labels to be placed along a line, either parallel or curved.
When the manual placement is enabled, an absolute X/Y coordinate is given by the user.
We propose to add an option so that the user can "orient" the placement of such curved or parallel labels.
The idea is to allow the user to set an "anchor point" that will be used by the labeling engine as a starting point of the label along the line.
The two fields used for the data-defined X/Y position will have a special meaning for curved / parallel labels. This coordinate will be projected onto the line to set the "anchor point". The PAL labeling engine will be modified to handle this.
It will be possible for the user to manipulate this anchor point for curved / parallel labels. The "move label" tool used for manual placement will display an anchor point constrained to be on the support curve/line.
Examples of curved labels with anchor points materialized
Multi-line support for curved labels
It is sometimes desirable to have multiple line labels for curved labels. But this feature is not supported yet by the labeling engine.
Following the discussion started here http://hub.qgis.org/issues/4442, we propose to handle multiline curved labels.
One option will be added to choose which algorithm is used to extend the linear support for labels that will be displayed below or above:
stay identical to the main curve, but the distance between two lines is not constant and may result in labels too close from one line to another and leads to labels not shown.
But it may results in curves with high curvatures that will also be ignored by the labeling engine. An option to specify the type of joins will also be available.
The labeling engine will then be modified to allow multiline candidates. In particular, the PAL code around the function createCurvedCandidatesAlongLine() will be modified to handle multiline labels.
![label_options](https://cloud.githubusercontent.com/assets/1618556/16414934/ecd7e2f8-3d3a-11e6-9b07-9719b6cbd75d.jpg)
The multiline labeling options will be reused to compute the shift or offset distance needed below and above the main line.
Placement candidates will be chosen in order to respect the alignment option.
Example(s)
Difference between lines computed by offseting and shifting the main support
![multiline_curved](https://cloud.githubusercontent.com/assets/1618556/16414658/2b83fb74-3d39-11e6-9cde-283f63d43ed6.jpg)
Issue Tracking ID(s)
http://hub.qgis.org/issues/4442
The text was updated successfully, but these errors were encountered: