Skip to content
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

curved labels: only a few are drawn #12173

Closed
qgib opened this issue Nov 18, 2009 · 28 comments
Closed

curved labels: only a few are drawn #12173

qgib opened this issue Nov 18, 2009 · 28 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling

Comments

@qgib
Copy link
Contributor

qgib commented Nov 18, 2009

Author Name: Paolo Cavallini (@pcav)
Original Redmine Issue: 2113
Affected QGIS version: 3.2
Redmine category:labelling


With the new labelling engine, I always get far too few labels when selection the "curved" option. See attached screenshot an sample file.



Related issue(s): #15916 (relates), #19124 (duplicates)
Redmine related issue(s): 6763, 10740


@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2009

Author Name: Martin Dobias (@wonder-sk)


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...

@qgib
Copy link
Contributor Author

qgib commented Jul 6, 2010

Author Name: Borys Jurgiel (@borysiasty)


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 #12856 are visible).

@qgib
Copy link
Contributor Author

qgib commented Feb 10, 2011

Author Name: Alister Hood (@AlisterH)


(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.

@qgib
Copy link
Contributor Author

qgib commented Jul 25, 2011

Author Name: Paolo Cavallini (@pcav)


  • pull_request_patch_supplied was configured as 0
  • tracker_id was changed from 1 to 4
  • start_date was configured as 2011-07-25

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was changed from Version 1.7.0 to Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2012

Author Name: Giovanni Manghi (@gioman)


  • version was configured as master
  • tracker_id was changed from 4 to 1
  • crashes_corrupts_data was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Giovanni Manghi (@gioman)


see also #14688


  • operating_system was changed from Debian to
  • priority_id was changed from Low to Normal
  • status_info was changed from 0 to

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0

@qgib
Copy link
Contributor Author

qgib commented Jul 28, 2012

Author Name: Giovanni Manghi (@gioman)


  • category_id was changed from Symbology to Labelling

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Sep 15, 2012

Author Name: Giovanni Manghi (@gioman)


  • assigned_to_id was changed from Martin Dobias to Larry Shaffer

@qgib
Copy link
Contributor Author

qgib commented Nov 17, 2012

Author Name: Anita Graser (@anitagraser)


  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Nov 27, 2012

Author Name: Larry Shaffer (Larry Shaffer)


See #15916 (comment) 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.


  • status_id was changed from Open to In Progress

@qgib
Copy link
Contributor Author

qgib commented Dec 30, 2012

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from High to Normal

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2014

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - High Priority

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2014

Author Name: Paolo Cavallini (@pcav)


Still far from optimal

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2014

Author Name: Paolo Cavallini (@pcav)


Partly duplicated in #19124

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2014

Author Name: aperi2007 - (aperi2007 -)


Hi,
in #19124.
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.
:)

Regards,

Andrea.

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2014

Author Name: Paolo Cavallini (@pcav)


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.

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2014

Author Name: aperi2007 - (aperi2007 -)


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.

A.

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2014

Author Name: Paolo Cavallini (@pcav)


I suggest the same approach as Alvaro OTF simplification, which is actually quite fast.
The default could be crafted so as to show all the labels, or this could be forced with an option.

@qgib
Copy link
Contributor Author

qgib commented Jul 21, 2014

Author Name: aperi2007 - (aperi2007 -)


Hi,

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.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 0
  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Jan 29, 2018

Author Name: Paolo Cavallini (@pcav)


Still true in master.

@qgib
Copy link
Contributor Author

qgib commented Feb 24, 2018

Author Name: Paolo Cavallini (@pcav)


  • assigned_to_id removed Larry Shaffer
  • version was changed from master to 3.0.0

@qgib
Copy link
Contributor Author

qgib commented Oct 14, 2018

Author Name: Tom Grundy (Tom Grundy)


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.


  • 13497 was configured as qgis_2113_parallel.png
  • 13498 was configured as qgis_2113_curved.png

@qgib
Copy link
Contributor Author

qgib commented Oct 14, 2018

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from In Progress to Open
  • version was changed from 3.0.0 to 3.2

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling labels May 24, 2019
@qgib qgib added this to the Future Release - High Priority milestone May 24, 2019
@nyalldawson nyalldawson self-assigned this May 28, 2019
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue May 28, 2019
conjunction with the "merge connected lines" setting

Refs qgis#12173
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue May 28, 2019
with line networks that contains forks and branches

And simplify memory management

Refs qgis#12173
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue May 28, 2019
nyalldawson added a commit that referenced this issue May 30, 2019
conjunction with the "merge connected lines" setting

Refs #12173
nyalldawson added a commit that referenced this issue May 30, 2019
with line networks that contains forks and branches

And simplify memory management

Refs #12173
@nyalldawson
Copy link
Collaborator

With #29994 I think this can be safely closed -- the remaining todo is allowing curved labels to overlap the ends of features, but that's an existing feature request: #15846

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 3, 2019
nyalldawson added a commit that referenced this issue Jun 3, 2019
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 10, 2019
conjunction with the "merge connected lines" setting

Refs qgis#12173

(cherry picked from commit 7213030)
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 10, 2019
with line networks that contains forks and branches

And simplify memory management

Refs qgis#12173

(cherry picked from commit e0aa09c)
nyalldawson added a commit that referenced this issue Jun 10, 2019
conjunction with the "merge connected lines" setting

Refs #12173

(cherry picked from commit 7213030)
nyalldawson added a commit that referenced this issue Jun 10, 2019
with line networks that contains forks and branches

And simplify memory management

Refs #12173

(cherry picked from commit e0aa09c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling
Projects
None yet
Development

No branches or pull requests

2 participants