[mapserver-dev] Labeling enhancements

Daniel Morissette dmorissette at mapgears.com
Wed May 27 15:20:21 EDT 2009


We're looking at making a couple of enhancements to the labelling 
algorithm to add more labels along long line or multiline shapes, and 
before I go ahead and write a RFC I would like to discuss this here and 
see if anyone has thoughts on this.

1- Label all the lines in a MultiLine shape:

At the moment, if you've got a MultiLine shape (i.e. a shapeObj with 
numlines > 1) then only the longest of the Lines is labelled. This is 
fine in most cases, but in some cases, we may want each individual Line 
in the MultiLine to get a label. That's the first enhancement that I 
would like to propose: make it possible to label all lines in a 
MultiLine shape.

2- Ability to repeat labels along a line with ANGLE FOLLOW

At the moment, with ANGLE FOLLOW, a label is placed at the center of the 
line. In the case of very long lines (roads), and especially when using 
metatiles to render a tile cache, we may want to repeat the label at 
some interval along the line. That's the second enhancement: make it 
possible to repeat the label at a given interval along a line when using 
ANGLE FOLLOW.


A possible way to control this in the mapfile could be to add a 
LABEL.REPEATDISTANCE parameter. By default this would be turned off and 
we would keep the current behavior. If REPEATDISTANCE is set to any 
value > 0 then the labels would be repeated on every line of a multiline 
shape (#1 above), and would be repeated multiple times along a given 
line at an interval of REPEATDISTANCE pixels (#2 above). In all cases 
the MINDISTANCE value would still be handled by the label cache so that 
multiple labels ending up too close to each other for various reasons 
would be eliminated by the label cache.

Since a picture is worth a thousand words, I have attached a picture 
showing what we currently get with a multiline and what we would like to 
get using the new REPEATDISTANCE keyword.

Any thoughts on this before I write a RFC?

Suggestions of a better name for the REPEATDISTANCE keyword?

Should we consider having separate keywords to control #1 (label each 
line in a multiline) and #2 (repeat labels along a line)?

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repeat_label.gif
Type: image/gif
Size: 6102 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20090527/fbd0e584/repeat_label.gif


More information about the mapserver-dev mailing list