[Qgis-developer] Multiple labeling layers ?

Martin Dobias wonder.sk at gmail.com
Thu Feb 12 06:19:21 PST 2015


On Thu, Feb 12, 2015 at 8:50 PM, Hugo Mercier <hugo.mercier at oslandia.com>
wrote:

> >
> >
> > Sounds good. Do I understand correctly you want to avoid having to
> > register features on every map rendering?
> >
> > What exactly would be cached - features / label candidates? for one view
> > / for the whole map?
>
> If I am correct, during labeling the most demanding task is the global
> optimization to compute label positions. So these label positions could
> be cached for one set of labels (in a labeling layer), provided the
> underlying vector layers are also cached.
>

Actually not - the global optimization is quite fast (after all that was
the intent of the PAL library), usually it is extraction of label
candidates and calculation of their costs (for polygons) that make up most
of the time.

In some cases finding of the solution can still be a bottleneck - e.g.
zoomed out map with huge amount of overlapping labels.

I have done measuring of the labeling performance quite a long time ago, so
it may be a good idea to check again where the speed issues are. Various
placement options have their own issues.



> I am also investigating another optimization idea: the good old global
> labeling on top of every other layers, but with a way to "partially"
> solve the placement problem. Could it be possible to inject precomputed
> label positions in PAL ?


Yes, this is already being done with data-defined positions of labels.


> So that a part of the label positions would be
> already known from a previous frame and some other labels would have to
> be recomputed ?


It is hard to guess what would help the most. Probably the best would be to
first measure the times of few scenarios and decide what/where/how to cache
based on the hard data.

Cheers
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150212/913c095a/attachment.html>


More information about the Qgis-developer mailing list