Opened 15 years ago
Last modified 13 years ago
#2866 new defect
Drawing ‘Straight’ label with LABEL_NO_CLIP, if “Follow” label drawing fails.
Reported by: | nnikolov | Owned by: | aboudreault |
---|---|---|---|
Priority: | normal | Milestone: | 5.6 release |
Component: | MapServer C Library | Version: | 5.2 |
Severity: | normal | Keywords: | LABEL_NO_CLIP option |
Cc: | sdlime |
Description
When ANGLE “Follow” option is set for label rendering, if a “follow” label drawing fails (in msPolylineLabelPath()) under some circumstances, it defaults to drawing ‘straight’ labels (using msPolylineLabelPoint()). However, when LABEL_NO_CLIP option is ON, the code does not follow the above logic. There are two identical places in mapdraw.c file (line 1403 - 1407 and 1605-1609) where the problem is:
if(layer->class[c]->label.autofollow == MS_TRUE ) {
annopath = msPolylineLabelPath(&annoshape, layer->class[c]->label.minfeaturesize, &(map->fontset), shape->text, &(layer->class[c]->label), layer->scalefactor, &status);
} else {
annocallret = msPolylineLabelPoint(&annoshape, &annopnt, layer->class[c]->label.minfeaturesize, &angle, &length);
}
The proposed fix is to replace the above lines (in both places) with the following lines:
if(layer->class[c]->label.autofollow == MS_TRUE ) {
annopath = msPolylineLabelPath(&annoshape, layer->class[c]->label.minfeaturesize, &(map->fontset), labelshapePtr->text, &(layer->class[c]->label), layer->scalefactor, &status);
}
/* Use regular label algorithm if angle is AUTO or a number, or if ANGLE FOLLOW failed */
if ( layer->class[c]->label.autofollow == MS_FALSE (!annopath && status != MS_FAILURE) ) { annocallret = msPolylineLabelPoint(&annoshape, &annopnt, layer->class[c]->label.minfeaturesize, &angle, &length);
}
Change History (5)
comment:1 by , 15 years ago
Milestone: | → 5.4 release |
---|---|
Status: | new → assigned |
comment:2 by , 14 years ago
comment:3 by , 13 years ago
Cc: | added |
---|
Alan: This looks to still be an issue, can you take a peek? The label path code is more complex in 6.0 and it's not clear at first glance how you detect failure. Must be a 0 in one of the counters.
Steve
comment:4 by , 13 years ago
Cc: | added; removed |
---|---|
Owner: | changed from | to
Status: | assigned → new |
Will take a look.
Steve, Do you want I take care of this one?