Opened 18 years ago

Closed 14 years ago

#54 closed enhancement (fixed)

label placement

Reported by: cavallini@… Owned by: wonder
Priority: major: does not work as expected Milestone: Version 1.4.0
Component: MapCanvas Version: Trunk
Keywords: Cc: blake@…, mgalen@…
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

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.

Attachments (2)

qgis_world_borders_default_labeling.png (224.8 KB ) - added by springmeyer 16 years ago.
QGIS default labeling when collision occurs
mapwindow_world_borders_default_labeling.png (91.6 KB ) - added by springmeyer 16 years ago.
Mapwindow default labeling with collision avoidance on

Download all attachments as: .zip

Change History (20)

comment:1 by anonymous, 18 years ago

Version: HEAD

comment:2 by anonymous, 18 years ago

Milestone: Version 0.9 Release

comment:3 by g_j_m, 18 years ago

See also ticket #297 for other label related enhancement requests

comment:4 by anonymous, 17 years ago

Awaiting user input: unset
Must Fix for Release: No

comment:5 by wonder, 16 years ago

Milestone: Version 0.9.1Version 1.0

This really needs more time :-/

Martin

comment:6 by hamish, 16 years ago

Hi,

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."

http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.label.sa/ http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.label.sa/annealing.c

good luck,

Hamish

comment:7 by springmeyer, 16 years ago

Cc: blake@… added

+ 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).

by springmeyer, 16 years ago

QGIS default labeling when collision occurs

by springmeyer, 16 years ago

Mapwindow default labeling with collision avoidance on

comment:8 by springmeyer, 16 years ago

Here are the sample images:

QGIS


QGIS default labeling when collision occurs

Mapwindow


Mapwindow default labeling with collision avoidance on

comment:9 by gsherman, 16 years ago

Cc: mgalen@… added

This will be addressed with the Google Summer of Code project to enhance labeling in QGIS.

comment:10 by steko, 16 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.

comment:11 by pcav, 16 years ago

The bug is a showstopper for milestone 1.0, IMHO

comment:12 by pcav, 16 years ago

Must Fix for Release: NoYes

comment:13 by msieczka, 16 years ago

In #297 there is a somewhat related patch.

comment:14 by timlinux, 16 years ago

Milestone: Version 1.0.0Version 1.1.0

We will be integrating the PAL label placement library for probably QGIS 1.1. They are finishing some changes and for other reasons we will not be applying this change in QGIS 1.0.

Regards

Tim

comment:15 by hamish, 15 years ago

Hi,

just to note that the project "Label placement for Quantum GIS" by Martin Dobias has been accepted for the 2009 Google Summer of Code.

see http://www.osgeo.org/node/895

Hamish

comment:16 by pcav, 15 years ago

See also #297; they should be closed together

comment:17 by pcav, 15 years ago

Component: GraphicsMapCanvas

comment:18 by lutra, 14 years ago

Resolution: fixed
Status: newclosed

This should be fixed with the new labelling framework now available in qgis-trunk.

Note: See TracTickets for help on using tickets.