Ticket #3030 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Labeling enhancements: ability to repeat labels along a line/multiline

Reported by: dmorissette Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: Documentation - MapServer Version: unspecified
Severity: normal Keywords:
Cc: jmckenna

Description

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 (item 1 above), and would be repeated multiple times along a given line at an interval of REPEATDISTANCE pixels (item 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 will attach 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 item 1 (label each line in a multiline) and item 2 (repeat labels along a line)?

Attachments

repeat_label.gif Download (6.0 KB) - added by dmorissette 3 years ago.
repeat_label.gif - Picture showing current and new behavior
label-comparison.jpg Download (201.3 KB) - added by aboudreault 3 years ago.
shield-comparison.jpg Download (207.3 KB) - added by aboudreault 3 years ago.
label_algorithm.gif Download (3.2 KB) - added by aboudreault 3 years ago.
The label algorithm

Change History

Changed 3 years ago by dmorissette

repeat_label.gif - Picture showing current and new behavior

Changed 3 years ago by aboudreault

Changed 3 years ago by aboudreault

Changed 3 years ago by aboudreault

I've attached two images for label comparison and shield comparison of the current and new behavior.

Changed 3 years ago by aboudreault

The label algorithm

Changed 3 years ago by aboudreault

  • cc jmckenna added
  • component changed from MapServer C Library to MapServer Documentation

Enhancements committed in r9194

Changed 3 years ago by dmorissette

See also RFC-57 for all the details: http://mapserver.org/development/rfc/ms-rfc-57.html

Changed 3 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Documentation updated in r9197.

Note: See TracTickets for help on using tickets.