<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 12, 2015 at 8:50 PM, Hugo Mercier <span dir="ltr"><<a href="mailto:hugo.mercier@oslandia.com" target="_blank">hugo.mercier@oslandia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">><br>
><br>
> Sounds good. Do I understand correctly you want to avoid having to<br>
> register features on every map rendering?<br>
><br>
> What exactly would be cached - features / label candidates? for one view<br>
> / for the whole map?<br>
<br>
</span>If I am correct, during labeling the most demanding task is the global<br>
optimization to compute label positions. So these label positions could<br>
be cached for one set of labels (in a labeling layer), provided the<br>
underlying vector layers are also cached.<br></blockquote><div><br></div><div>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.</div><div><br></div><div>In some cases finding of the solution can still be a bottleneck - e.g. zoomed out map with huge amount of overlapping labels.</div><div><br></div><div>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.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am also investigating another optimization idea: the good old global<br>
labeling on top of every other layers, but with a way to "partially"<br>
solve the placement problem. Could it be possible to inject precomputed<br>
label positions in PAL ?</blockquote><div><br></div><div>Yes, this is already being done with data-defined positions of labels.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> So that a part of the label positions would be<br>
already known from a previous frame and some other labels would have to<br>
be recomputed ?</blockquote><div><br></div><div>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.</div><div><br></div><div>Cheers</div><div>Martin</div><div><br></div></div></div></div>