[mapserver-dev] Labelcache potential optimization using spatial index

Daniel Morissette dmorissette at mapgears.com
Thu Feb 21 07:04:57 PST 2013

On 13-02-21 9:46 AM, Stephen Woodbridge wrote:
> Daniel,
> I think I missing what the potential problem is or how you intent for
> this to be used.
> If we use the logic we have today, we add a drawn label bbox to the
> RTree index, when we want to check for a collision we check the next
> label again the RTree index. This would be faster than the linear search
> we do today, right? And this does not care about priority. Priority
> comes into play when selecting the order of label drawing.

Well, at the moment the cached labels are in a chained list IIRC and 
within a given LABEL.PRORITY level we render them in a last in first out 
(LIFO) order.

If we replace the chained list with a spatial index (Rtree or other) 
then we lose the sequential nature of the chained list and the LIFO 
ordering feature that users have come to rely on goes away.

All that's left in this case to really control label rendering order is 
the LABEL.PRIORITY which is optional and probably not used very often by 
users. What I'm saying is that if we switch to a spatial index then 
users would be required to make better use of LABEL.PRIORITY.

Daniel Morissette
Provider of Professional MapServer Support since 2000

More information about the mapserver-dev mailing list