Feature request #54
|Pull Request or Patch supplied:||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||10113|
A wish: label placement should be improved,
especially for printing, avoiding overlapping and
collisions and repetion of the same label on several
islands of the same feature.
#3 Updated by hamish - over 11 years ago
You might look at v.label.sa in GRASS 6.3 for some nice algorithm,
v.label.sa: "Create paint labels, but use a Simulated Annealing algorithm to avoid overlaping labels."
"_v.label.sa_ makes a label-file from a GRASS vector map with labels created from attributes in the attached table. The labels are placed in as optimal place as possible."
#4 Updated by springmeyer - over 11 years ago
+ 1 on this being a fairly critical. I would support prioritizing default collision avoidance / filtering as a first feature. This could be a checkbox in the label tab that is on by default and would prevent layers from rendering all their labels when major overlap/collision will occur. This will help basic QGIS aesthetics and performance. An example of the performance hit is that when rendering a world_borders shapefile ( ~500kb) and all the country name labels are placed by default, QGIS hangs unresponsively for about 7 seconds. (I'm running 0.10.0 on Max OS 10.5 with 2GB ram and loading the shapefile from http://thematicmapping.org/downloads/TM_WORLD_BORDERS_SIMPL-0.2.zip).
I just ran a quick comparison with this same sample data in uDIG, Mapwindow, and ArcMap and all three have either a default collision algorithm set or an easy checkbox available to avoid collision and therefore render the world_borders shapefile much faster when labels are requested. This feature will have a big impact on the first-impressions of new users if implemented.
I'll attach two graphics comparing the default labeling in qgis with the default labeling in mapwindow (with collision avoidance).
#5 Updated by springmeyer - over 11 years ago
Here are the sample images:
#7 Updated by Stefano Costa - over 11 years ago
Mapserver does the same thing (i.e. automatic removal of labels that collide until there are no collisions). See http://mapserver.gis.umn.edu/docs/reference/mapfile/label (POSITION directive) and http://trac.osgeo.org/mapserver/browser/trunk/mapserver/maplabel.c#L196
This doesn't mean the same code can be used, but it shouldn't be difficult to re-use at least the same algorithm used there.