[QGIS-Developer] Custom label placement per layout

Nyall Dawson nyall.dawson at gmail.com
Fri Aug 7 18:26:25 PDT 2020


On Sat, 8 Aug 2020 at 03:05, Spencer Gardner <spencergardner at gmail.com> wrote:
>
> I've loved the improved functionality for custom label placement in QGIS 3 but I've come across one issue that I assume is common to many users. When a label is manually placed on the map, that placement applies to every map layout regardless of scale or extent. This can create problems if, for example, I'm working with a map document with layouts at different scales.
>
> I'm wondering if there's a trick that would allow me to place labels specific to a certain Composer layout so that I can vary the placement for each layout.
>
> If this is impossible currently, does it make sense to consider as a QEP? I think there are some major technical challenges, not least of which is figuring out how to allow a user to tweak label placement inside the Composer window, but the improvement in label quality would be immense (for me, at least).

It's a horrible workflow, but I usually end up:

1. manually adding additional auxilliary fields to the table, e.g.
"label_x_layout_1", "label_y_layout_1"
2. switching the data defined x/y for the label to use one particular
set of these fields, and using the move label tool to get the
placement right. Repeat.
3. change the data defined x/y from fields to expressions like

case when @layout_name = 'xxxxxx' then @aux_field_label_x_layout1
    when @layout_name = 'yyyy' then @aux_field_label_x_layout2
end

etc.

I warned you it was horrible! So yeah, QGIS is capable of handling
this situation, but we need a much nicer workflow for exposing it.
Ideas welcome!

Nyall


>
> Thanks for any thoughts,
> Spencer
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list