[Qgis-developer] New adv labeling freeze-thaw tools

Larry Shaffer larrys at dakotacarto.com
Mon Aug 6 21:20:14 PDT 2012


Hi John,

On Mon, Aug 6, 2012 at 8:38 PM, John C. Tull <jctull at gmail.com> wrote:
> Hi Larry,
>
> On Aug 6, 2012, at 1:28 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:
>
>> * Improve Change Label dialog:
>> - Temporarily add (colored) PAL solution x, y, rot info to specific
>
> If I understand you correctly on this improvement idea, a hearty +1 from me.
>
> My read on this is that layers without x, y, and rotation fields will store frozen label information and allow them to be placed despite lacking those fields. Ideally, upon committing the changes (i.e., taking the layer out of editing mode), a prompt to save the information and assign to existing or create the appropriate fields would be given to the user.
>
> Is this right, or am I day-dreaming? My test last week on a handy layer did not allow me to move labels because I did not have said fields identified or available.

Unfortunately, you're dreaming. ;^) What I was referring to was a
situation where your table already has the columns (x, y and rotation)
and has them mapped, but they still contain NULL values. I've recently
updated the move tool to automatically freeze all of the PAL
solution's data on initial move (before rotation and alignment were
not used).

But, with the Change Label tool, if you haven't frozen or moved (also
frozen) a label's location data (i.e. still a dynamic label), the x, y
and rotation form fields are all set to 0 (representing NULL) [0]. You
basically can't put anything in the x or y fields because you probably
have no accurate idea what it would be; so you end up having to freeze
the label by other means first. However, the would-be frozen PAL data
from the label can be loaded into the fields (I'm now thinking with a
Load Position button). Then, clicking OK will essentially freeze the
label, just like with the other two tools, but with the added ability
to edit right before freezing.

Your idea of creating the columns is great. I don't think I would do
it after editing though. If it failed, you might lose your temporal
data. A better solution might be to incorporate an 'Add Columns to
Data Source' button in the data-defined settings section, that would
be greyed-out if not in edit mode or the fields already exist[1]. This
is a layer-level action, so it's better suited to that dialog than
with the Change Label manipulation tool.

Generating the columns could also automatically map them for labeling.
A nice feature to an 'Add Columns...' button would be the option to
pre-define default values to populate the column fields with. Then,
advanced labeling could basically be all GUI-based for general usage,
except for later batch-editing (for which I also have some ideas).

Check out Régis's 'EasyCustomLabeling' plugin for another, separate
memory layer approach.

[0] https://dl.dropbox.com/u/4058089/qgis/change-label_nodata.png
[1] https://dl.dropbox.com/u/4058089/qgis/label-settings_add-columns.png

Regards,

Larry

>
> Cheers,
> John


More information about the Qgis-developer mailing list