Note: This document is a draft
This page should contain various information about overall design and usage of map labeling that will be implemented in QGIS. New labeling system should bring much more flexibility and offer easy to use interface.
For information on the current development status compare: Label Placement GSoC 2009
Features¶Most important additions:
- collision detection for labels to protect them against overlapping
- splining labels to follow paths
- manual editing of labeling - changing position, size, direction ...
- reducing manual editing time with automatic label placement
- static (high-quality) - after defining placement rules, labeling is computed once and labels get static positions. User can later tweak the labeling for his needs
- dynamic (low-quality) - placement is being calculated with every change of the view, speed of the placement is more important than the quality of the resulting labeling. This option is better choice for those who just want to browse the maps without much configuration.
TODO: how to develop easy to use interface?
Design¶TODO: ideas how to incorporate the system in the QGIS
- represent labeling as a special vector layer?
- only one common layer for all labels or multi-layer approach?
- should be labeling "always on top" or can get behind another layer? comment by regis 26 11 2011: I confirm that users need this. We often use mask layers to highlight an interest area. _ _Being able to draw labels under mask layer would be perfect. The opposite solution would be too allow some layers to draw on to of all graphics and labels._
- how to incorporate with the new legend?
- Alexander Wolff's pages about map labeling - contain much useful information about point, line and general labeling algorithms with a great bibliography
- Automatic Label Placement in Theory and Practice - disertation of A. Wolff (in PDF)
- Force Directed Map Labeling - project aiming at point labeling with implementation in Java (sources included)
- OpenLabel - labeling subsystem for OpenMap project
Comments by Tim¶
For non automated label placement, one thing to consider is a 'click to label' feature that works in a similar way to the identify tool but rather places a lable onto the map at that point. The placed lable could have slection handles that allow rotation of the label. A round dot placed in the center of the label will allow you to grab and shift the label position when it it selected.For storing label placements you could consider three approaches (possiby implementing both)
- Store lable placement and properties in the project file
- Store label placement in a simple xml file or sqlite file associated with a layer. Sqlite may be a bterrer option in that yuo can perform a spatial query efficiently so that at render time you can easily extract only lables in the current AOI
- Store the labels by adding attribute fields to the dataset itself and then populating these fields when label placement is carried out.
Currently multipart features are not labelled. Could you add sorting that out to your todo list?