2

I have my labels set on curved. Unfortunately quite often happens, that the curved label remains not visible because my line is too short on the map. I can't make my map larger, because I need some minimum area to cover. The example you can see below.

enter image description here

I have two lines, where the curved line is visible for this one, which is long enough. It's not visible for a shorter lines. In this event, I have to toggle between curved and parallel label appearance.

Is it possible to set the parallel label only for the item, which will be too short for the curved label to be visible?

3

QGIS's ability to specify rendering parameters in map units (m, etc.) or display units (rendered mm) and to use data-driven over-rides are impressive and may be able to get you what you need. Alternatively, you can fake it. Try:

  1. Setting Layer properties / Layers / Placement / Label overrun distance to a large value in rendered units (mm) to allow significant label overrun.

  2. Using data-driven override for the same overrun, or perhaps label font size, with an expression which conditions on the variable @map_scale. This is the scale of the map as being shown or rendered, and you could increase to overrun or decrease the font size for more zoomed-out maps while keeping it tighter for better looking detail maps.

  3. Unfortunately, the curved setting for labels does not allow a data-driven override, so you can't condition on @map_scale. However, you could duplicate your layer, give the 2 duplicate copies different Layer properties / Rendering / Scale dependent visibility and then tweak the labeling settings differently in the 2 copies (including whether they're curved, appear at all, etc.). Depending on the scale at rendering time, one or other of the duplicates will appear.

2

You can enable the labeling in the placement section:

enter image description here

Try some values in the "Suppress labeling of features smaller than" section. More information can be found here: https://docs.qgis.org/3.16/en/docs/user_manual/style_library/label_settings.html?highlight=label#placement-for-line-layers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.