Opened 18 years ago

Closed 15 years ago

#297 closed enhancement (duplicate)

labels are missplaced

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

Description

See the screendump. There are labels 1246, 799 and 1205 in the center. Can you see them? Good.

The problem is that 1246 belongs to the selected, yellow-highlighted polygon, 799 to the greyish polygon and 1205 to the greenish one. But the way they are displayed, you wouldn't guess that they are. Zooming or playing with label positioning doesn't fix the problem. The 1246 is worst.

This is not a separated case - it is a common bug when displaying narrow, long polygons.

Maciek

Attachments (2)

labels_bad.png (53.9 KB ) - added by tutey@… 18 years ago.
bug297fix.diff (6.6 KB ) - added by jef 16 years ago.

Download all attachments as: .zip

Change History (13)

by tutey@…, 18 years ago

Attachment: labels_bad.png added

comment:1 by g_j_m, 18 years ago

Milestone: Version 0.8 ReleaseVersion 0.9 Release
Type: bugenhancement

Qgis currently displays polygon and linestring labels at the position given by the mean of the points that define the polygon or linestring. Label 1246 looks to be in the appropriate place under that scheme.

More intelligent placing of labels is something that we are planning for later releases of qgis. In the meantime, it is possible to use the 'Data defined position' abilities of the label dialog box to use data in your data source to place labels.

See ticket #54 for some other wishes to do with labels.

comment:2 by tutey@…, 18 years ago

Maybe I don't get something, but the way I understand what you are saying means that the 1246 should be somewhere within the the polygon it belongs to, ie. the yellow-highlited one? But it's not, as yuo can see - it's way under that polygon. This is the main problem.

Maciek

comment:3 by g_j_m, 18 years ago

An example - if you have a polygon that is similar to your highlighted one where it is a u shape. The mean of all of the points that make up the polygon will be somewhere in the middle of the u, and not necessarily inside the polygon boundaries.

comment:4 by tutey@…, 18 years ago

Thanks, now I get it.

In that case, I consider it a serious defect than convex shapes are labelled wrong "by design". I find it strange it's not planned to be fixed for 0.8 and that you consider it an "ehnacement".

Maciek

comment:5 by anonymous, 18 years ago

In OGC terms, it should be used PointOnSurface instead of Centroid.

in reply to:  4 comment:6 by timlinux, 17 years ago

Awaiting user input: unset
Milestone: Version 0.9Version 1.0
Must Fix for Release: No

Replying to tutey@o2.pl:

Thanks, now I get it.

In that case, I consider it a serious defect than convex shapes are labelled wrong "by design". I find it strange it's not planned to be fixed for 0.8 and that you consider it an "ehnacement".

Maciek

Hi

We can only plan work if there is someone willing, available and able to do the work. Martn Dobias is planning to redo the labelling implementation at some stage, and until that time we only offer the simple centrod based labelling as currently available in QGIS. For 0.9 we will still have teh current labelling implementation so I am shifting this bug report over to 1.0. I'm leaving its status as 'Major' though since I do agree that its something we should try to resolve before the final QGIS Stable Version 1.0 release

Regards

Tim

comment:7 by jef, 16 years ago

fix in attached patch. Use GEOS's getInteriorPoint to determine label points. This is an configurable options as it has a large performance impact.

by jef, 16 years ago

Attachment: bug297fix.diff added

comment:8 by msieczka, 16 years ago

Must Fix for Release: NoYes
Platform: LinuxAll
Platform Version: Ubuntu Dapper

Could the patch by Jurgen be applied for 1.0?

comment:9 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:10 by pcav, 15 years ago

See also #54, of which this is essentially a duplicate

comment:11 by trapanator, 15 years ago

Resolution: duplicate
Status: newclosed

closing, duplicate

Note: See TracTickets for help on using tickets.