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

Add maximum distance setting for point labels (Request in QGIS) #9120

Closed
qgis-bot opened this issue May 23, 2024 · 0 comments · Fixed by #9301
Closed

Add maximum distance setting for point labels (Request in QGIS) #9120

qgis-bot opened this issue May 23, 2024 · 0 comments · Fixed by #9301
Labels
3.38 QGIS 3.38 new features Labels Layer labels properties Style manager
Milestone

Comments

@qgis-bot
Copy link
Collaborator

Request for documentation

From pull request qgis/QGIS#57415
Author: @nyalldawson
QGIS version: 3.38

**Add maximum distance setting for point labels **

PR Description:

(Temporarily includes qgis/QGIS#57404)

For the "Around point" and "Cartographic" placement modes, this adds a new optional setting for the maximum distance of the labels from the feature. It's used together with the existing distance setting to define a range of distances at which labels may be placed from their corresponding point features.

This adds more flexibility to the placement for these layers, ultimately allowing for more labels to be placed in busy maps.

When the layer is set to the "around point" mode, then label candidates which are closer to the point will always be prefered
over those which are further away.

When the layer is set to the "cartographic" mode, then the default behavior is also to prioritize closer labels. A new combo box
allows users to control the priority, with an option for prefering position ordering. If this option is set, then candidates at the corresponding positions (eg top left) are preferred regardless of how far they are from the point, with the labelling falling
back to alternate positions only when no labels can be placed up to the maximum label distance.

Sponsored by Rubicon Concierge Real Estate Services

To demonstrate, here's how the candidates look for a standard point layer in cartographic mode:

image

If we bump the maximum distance to 4.5 mm, then here's how the candidates look:

image

These videos demonstrate how the prioritization setting affects things:

In the default "prefer closest" mode, the label will remain as close as possible to the point. The top right placement is initially prefered, but then we fall back to close labels on the top right, bottom right, bottom left, etc. More distant labels are only placed as a last resort:

Peek.2024-05-14.15-02.mp4

In "Prefer position ordering" mode, the label will prefer to stay in the top right placement, immediately falling back further candidates to the top right. It's only when no candidates can be placed in the top right within the maximum distance that it falls back to the top left placement.

Peek.2024-05-14.15-02.3.mp4

Commits tagged with [need-docs] or [FEATURE]

"[feature] Add maximum distance setting for point labels\n\nFor the "Around point" and "Cartographic" placement modes, this\nadds a new optional setting for the maximum distance of the labels from\nthe feature. It's used together with the existing distance setting\nto define a range of distances at which labels may be placed\nfrom their corresponding point features.\n\nThis adds more flexibility to the placement for these layers,\nultimately allowing for more labels to be placed in busy maps.\n\nWhen the layer is set to the "around point" mode, then label\ncandidates which are closer to the point will always be prefered\nover those which are further away.\n\nWhen the layer is set to the "cartographic" mode, then the default\nbehavior is also to prioritize closer labels. A new combo box\nallows users to control the priority, with an option for\nprefering position ordering. If this option is set, then candidates\nat the corresponding positions (eg top left) are preferred regardless\nof how far they are from the point, with the labelling falling\nback to alternate positions only when no labels can be placed\nup to the maximum label distance.\n\nSponsored by Rubicon Concierge Real Estate Services"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.38 QGIS 3.38 new features Labels Layer labels properties Style manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants