[mapserver-dev] Labeling enhancements

Steve Lime Steve.Lime at dnr.state.mn.us
Wed May 27 23:30:35 EDT 2009


What about just using MINDISTANCE parameter and simply making a 
"REPEAT YES|NO" parameter? Depending on how you implemented (one
label with multiple label points vs. multiple labels) you'd have to deal
with that parameter anyway. REPEAT would trigger multiple labels with
MINDISTANCE defining the distance between them on the line but also
as the crow flies. Perhaps too simple.

Steve

>>> Daniel Morissette <dmorissette at mapgears.com> 05/27/09 2:21 PM >>>
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/



More information about the mapserver-dev mailing list