Opened 15 years ago

Closed 15 years ago

#3050 closed enhancement (fixed)

MINDISTANCE not considering label size on lines

Reported by: adube Owned by: aboudreault
Priority: normal Milestone:
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords: mindistance
Cc: adube, dmorissette, sdlime

Description

Distance between labels do not consider the label size. If you have a long label on a line with a MINDISTANCE of let's say 80, we don't have 80 pixels between labels. Instead, we have 80 pixels between the position of the labels.

Since the new REPEATDISTANCE do consider the label size, it should be the same thing with MINDISTANCE.

I'll come up with a sample data test that demonstrates the problem.

Attachments (2)

mindistance-problem.png (44.5 KB ) - added by adube 15 years ago.
MINDISTANCE 80, should be 80px between Dudley Ave, currently not
3050.tar.gz (120.2 KB ) - added by adube 15 years ago.
A sample dataset showing the bug.

Download all attachments as: .zip

Change History (9)

by adube, 15 years ago

Attachment: mindistance-problem.png added

MINDISTANCE 80, should be 80px between Dudley Ave, currently not

comment:1 by adube, 15 years ago

Type: defectenhancement

by adube, 15 years ago

Attachment: 3050.tar.gz added

A sample dataset showing the bug.

comment:2 by aboudreault, 15 years ago

Cc: adube dmorissette added; adube@… removed

Since the label size is calculated before the calls of msTestLabelCacheCollisions(), we could simply add it as a parameter to the msTestLabelCacheCollisions() function. Then, we verify that the distance between the 2 points is <= than the mindistance value + half the size of the label (ie. if the label position if CC). What do you think?

comment:3 by dmorissette, 15 years ago

Cc: sdlime added

Sounds like an acceptable fix. Adding Steve to CC to get his opinion.

comment:4 by sdlime, 15 years ago

Not perfect but better than what's there and a heckuva lot faster than checking the true distance between a cached label's polygon. Have you tried it?

Steve

comment:5 by aboudreault, 15 years ago

Not yet tried. Will test the proposed method in the next days.

comment:6 by aboudreault, 15 years ago

Seems to work well, I've simply added the label_size to the mindistance value when checking the point to point distance. That way, I ensure that there is really the mindistance value between the two labels

comment:7 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

Fixed and committed in r9198.

Note: See TracTickets for help on using tickets.