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

Label with "using perimeter" option looses label and do not work as expected #15973

Closed
qgib opened this issue Dec 6, 2012 · 7 comments
Closed
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 Dec 6, 2012

Author Name: Regis Haubourg (@haubourg)
Original Redmine Issue: 6835
Affected QGIS version: master
Redmine category:labelling
Assignee: Larry Shaffer


Hi,
Using perimeter labeling option is not working well when labeling a polygon not entirely contained in mapCanvas extent. Polygon is clipped with extent and label is applied to that part.
Two major drawbacks:

  • when using options above-on-below line, some labels are drawn outside screen extent. See joined screen capture. when using below line option, label disappear at the bottom and right side of the canvas. Reversed behaviour for "above" option. Half cut label for "On" OPtion
  • Apart from drawing labels outside the screen, thhos labels shouldn't be drawn on Side of mapCanvas, but following the uncropped lines inside mapCanvas? See third image that simulate the theorical behaviour expected.

As a solution, I suggest that polygons intersecting current extent be converted to lines and clipped with extent, and labeled with same algorithm as "Line" uses. That way, only real boundary can be used to label polygon. That would solve both issues.
regards.
I'm affecting it to Larry because I know he has a good global vision of labeling tools. Feel free to reaffect
Régis


@qgib
Copy link
Contributor Author

qgib commented Dec 7, 2012

Author Name: Larry Shaffer (Larry Shaffer)


Hi Régis,

This issue may be solved by implementing a separate feature request. See "Add option to have boundaries of map canvas's current extent act as obstacles to labels" under Placement options in [[New Labeling changes and roadmap#Placement-options]].

Essentially, this would not affect the geometries (clipped or not) used for the perimeter labeling. What it would do however is to make the extent's geometry a feature(s) that is considered an obstacle to labels. I'm looking at making that obstacle variable in size, e.g. @(extent - [px- or map unit-sized buffer])@. This would keep the extent-clipped-edge labels from being considered as candidates for perimeter labeling as well. This also helps greatly for QGIS Server, where problem labels (as you have indicated) cause issues when generating/caching tiles.

I am looking to implement that sometime this month (Dec. 2012).

Note: could you add the screen snaps you reference?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Dec 9, 2012

Author Name: Regis Haubourg (@haubourg)


Here are the screenshots! sorry for that


  • 5166 was configured as label_using_perimeter_wished.png
  • 5164 was configured as label_using_perimeter_above_line.png
  • 5165 was configured as label_using_perimeter_below_line.png

@qgib
Copy link
Contributor Author

qgib commented Dec 9, 2012

Author Name: Regis Haubourg (@haubourg)


Considering the map canvas's extent as obstacles to labels seems a good idea, and maybe more simple to implement.
Just a few questions, won't it make an area free of any label in that variable buffer zone?
What about small parts of polygons that user would like to label anyway? Users may want to force labeling of those. Is option "Show all labels for this layer (including colliding labels)" a solution for that?
Thanks a lots
Régis

@qgib
Copy link
Contributor Author

qgib commented Dec 10, 2012

Author Name: Larry Shaffer (Larry Shaffer)


regis Haubourg wrote:

Just a few questions, won't it make an area free of any label in that variable buffer zone?

Yes. But, isn't that the point? The buffer zone doesn't need to be much bigger than the individual perimeter lines of the extent. A user may want to increase the buffer when generating tiles (as an example).

What about small parts of polygons that user would like to label anyway? Users may want to force labeling of those. Is option "Show all labels for this layer (including colliding labels)" a solution for that?

I think an extent buffer zone would override any setting like "Show all labels for this layer (including colliding labels)" since such a setting would negate it. Assuming the small parts of the clipped polygon in question were still capable of being labeled, then setting a very thin extent buffer zone (as described above) might do the trick.

Concerning very small visible bits of features that generally wouldn't be labeled, that's another issue. Currently, if the label doesn't 'fit' within the length of the feature, it is not drawn. "Show all labels for this layer (including colliding labels)" will only show all labels that would generally be drawn, but skip hiding labels that would be hidden due to collisions, i.e. all overlaps of labels are allowed and shown.

@qgib
Copy link
Contributor Author

qgib commented Aug 13, 2013

Author Name: Sandro Santilli (@strk)


I'm also missing the "Line direction symbol" for perimeter labels, so I'd welcome threating polygon perimeters fully as lines too. Do you see any problem with that, Larry ?

image

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2014

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Oct 10, 2016

Author Name: Nyall Dawson (@nyalldawson)


Fixed in recent versions


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@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 - Nice to have milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
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

1 participant