Bug report #2113
curved labels: only a few are drawn
|Affected QGIS version:||3.2||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||12173|
With the new labelling engine, I always get far too few labels when selection the "curved" option. See attached screenshot an sample file.
#1 Updated by Martin Dobias over 11 years ago
The problem is that either the shapes are too short (the label wouldn't fit on the line) or the shapes are too complex and creation of labels candidates fails because the succesive characters would be otherwise rotated "too much", resulting in unreadable labels.
I don't know what should be a correct solution for this. The engine could try to detect such complex shapes and try to simplify on-the-fly them before creating candidates...
#2 Updated by Borys Jurgiel about 11 years ago
Even on simpler lines, as streets, the curvature threshold seems too low. I can imagine much more curved labels would be still good-looking. Anyway, even if it's acceptable on display, on printouts (or exported files; no matter rasterized or not) it is definitely not. See screenshots label2-* (also wrong scaling and #2796 are visible).
#3 Updated by Alister Hood over 10 years ago
(sorry, I was meant to post this before attaching)
I agree with this:
Even on simpler lines, as streets, the curvature threshold seems too low.
But I also think that this is necessary:
The engine could try to detect such complex shapes and try to simplify on-the-fly them before creating candidates...
See the labelling on the roads in P1080123_cropped_1.jpg for an example.
#13 Updated by Larry Shaffer over 8 years ago
- Status changed from Open to In Progress
See #6763-6 for update on related issue.
Please test with ee12df2 and inside and outside angles greater than 20 to see higher label count (especially if you still have the original data). Some comparison screen snaps again would be nice.
Any settings higher than inside of 30 or outside of 50 (and possibly lower in some cases) will start producing some funky-looking labels. QGIS <= 1.8 had a setting of 20 for both angles.
#18 Updated by aperi2007 - about 7 years ago
I give a potential solution.
My solution is to enhance the code to support an optionally second change to not lost any label that don't allow to be curved. Putting it parallel.
It is quite flexible because it give the grant to not lost any label.
Actually no one of out power users use the curve string solution. Because they are always the question to know if lost any label.
Out map infct could not lost any label.And so they use always the parallel strings to be sure to have all the labels.
I guess the parallel string as an otherwise solution could be supported using a checkbox to active it optionally.
This probably could help to use the curve solution.
I like to know if this feature could be accepted.
Please note that don't mean that we are capble to fund this solution.
This is only a proof of concept to understand if there is a potential solution for this.
One time to decide what is the solution.
The second point is understand how much cost to develope it.
#19 Updated by Paolo Cavallini about 7 years ago
As discussed on the mailing list long ago, probably the best approach would be to simplify (generalize) complex (multi)lines on the fly, so that the labels will follow the best approximation to the original curve, without becoming too garbled or disappearing altogether.
I suggest to use a similar approach to geometry simplification done by Alvaro, maybe even some of the same functions.
#20 Updated by aperi2007 - about 7 years ago
The simplify approach is could be affordable for a print goal .
But could be too slowly for a web browsing map.
Almost if the question is a run-time simplify approach.
Are you speaking of an extra layer maually added to the project and simplified previously offline.
Rendered also with 100% transparency and used to obtain the curved label ?
I guess the primary question is not resolved however.
Infact after the simplify, no-one could know if the simplify was sufficient to avoid the lost of the label.
Or you are speaking of an iterative simplification increasing the simplify untile the label could appear ?
This could work but I guess it could be mortally slow.
Not more on qgis-desktop where the asynchornocity of the multithread could assure to do this meanwhile qgis do other thinks,
but instead on qgis-server where the mp is before produce and after send.
It could slow the map production of an impredictable time due to the situation of label on that portion f map.
#22 Updated by aperi2007 - about 7 years ago
we like to understand if this problem is resolvable or not.
The solution proposed:
As discussed on the mailing list long ago, probably the best approach would be to simplify (generalize) complex
(multi)lines on the fly, so that the labels will follow the best approximation to the original curve, without
becoming too garbled or disappearing altogether.
I guess in not a sure solution.
I understand it augment the statistically of label curved used, and reduce the statistical of label lost, but we need to have Label Lost = 0 (zero) .
The try to introduce this need n a simplifiy algorithm will introduce an iterative procedure that could put the time to elaborate to infinite.
I guess to grant this is necessary to introduce a rule specific like this:
is the single label is not fittable in a curved line it will put parallel.
#26 Updated by Tom Grundy almost 3 years ago
This problem still exists in 3.2.1. I tried increasing letter spacing and changing to all-caps for the letter sizes to be more predictable, but did not see any improvement. Images attached with labeling set to parallel and another with labeling set to curved with no other changes.