Opened 15 years ago

Last modified 15 years ago

#3009 assigned defect

getLabelPoint() does not work for polyline and point layers.

Reported by: kfaschoway Owned by: sdlime
Priority: normal Milestone:
Component: MapScript-SWIG Version: 5.2
Severity: normal Keywords:
Cc:

Description

Using the feature method getLabelPoint(), this works for polygon layers but not for polyline layers, it always return nulls. While looking at the source code, in mapscript_i.c, we see the check being done for if it’s a shape of type polygon; otherwise a null value is returned. pointObj *shapeObj_getLabelPoint(shapeObj *self) {

pointObj *point = (pointObj *)calloc(1, sizeof(pointObj)); if (point == NULL) {

msSetError(MS_MEMERR, "Failed to allocate memory for point", "getLabelPoint()"); return NULL;

}

if(self->type == MS_SHAPE_POLYGON && msPolygonLabelPoint(self, point, -1) == MS_SUCCESS)

return point;

free(point); return NULL;

}

Why polyline, or point also, does not return a point object. Since there is a msPolylineLabelPoint(…) in mapprimitive.c, shouldn’t polyline object be also supported when trying to get the point of the label? Shouldn’t the point object should be also supported?

Attachments (7)

bug_getLabelPoint.map (2.5 KB ) - added by kfaschoway 15 years ago.
BugMapserver_LabelGetPoint.DAT (13.2 KB ) - added by kfaschoway 15 years ago.
BugMapserver_LabelGetPoint.ID (556 bytes ) - added by kfaschoway 15 years ago.
BugMapserver_LabelGetPoint.IND (3.5 KB ) - added by kfaschoway 15 years ago.
BugMapserver_LabelGetPoint.MAP (30.0 KB ) - added by kfaschoway 15 years ago.
BugMapserver_LabelGetPoint.TAB (267 bytes ) - added by kfaschoway 15 years ago.
symbols.list (7.0 KB ) - added by kfaschoway 15 years ago.

Download all attachments as: .zip

Change History (8)

by kfaschoway, 15 years ago

Attachment: bug_getLabelPoint.map added

by kfaschoway, 15 years ago

by kfaschoway, 15 years ago

by kfaschoway, 15 years ago

by kfaschoway, 15 years ago

by kfaschoway, 15 years ago

by kfaschoway, 15 years ago

Attachment: symbols.list added

comment:1 by sdlime, 15 years ago

Component: MapServer C LibraryMapScript-SWIG
Status: newassigned
Note: See TracTickets for help on using tickets.