[Qgis-developer] Freeze dynamic labels in advanced labeling

Larry Shaffer larrys at dakotacarto.com
Thu Jul 12 09:37:35 PDT 2012


Hi Régis,

On Thu, Jul 12, 2012 at 6:45 AM, haubourg
<regis.haubourg at eau-adour-garonne.fr> wrote:
>
> Larry_S wrote
>>
>>
>> Is there a means to have PAL layout the labels, then do something to
>> freeze (write) *all* labels' x/y coords to the data source?
>>
>
> Hi, +1 for that functionnality.
>
> I wrote a plugin to duplicate a layer and add advanced labeling fields in
> order to quickly make a "labeling ready layer". having XY prelocated thanks
> to PAL is big feature I miss.
>  (I have some more things to fix before releasing it.. )

I have an immediate need on my current project for just such a plugin!
Please contact me directly if you don't mind sharing it a bit before
release.

The logic in my patch to freeze dynamic labels comes just after the
labels are drawn to the canvas using PAL. It currently can't write all
layer labels to its source (or a duplicated layer) unless all the
labels can be shown in the canvas when zooming to the layer's extent,
which is possible in some labeling setups.

In other words, with my approach, it requires some specific setup or
interactivity from the user. The freeze labels tool I'm working
towards (need it on my project with thousands of labels right now) is
basically an interactive one, similar to the other labeling tools.

It may be possible to mimic those actions in a plugin, to freeze all
labels for a layer, but it won't be very elegant until the Python
access is crafted, as mentioned by Martin (unless you are coding your
plugin in C++, I guess).

Regards,

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota


More information about the Qgis-developer mailing list