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)
Change History (8)
by , 15 years ago
Attachment: | bug_getLabelPoint.map added |
---|
by , 15 years ago
Attachment: | BugMapserver_LabelGetPoint.DAT added |
---|
by , 15 years ago
Attachment: | BugMapserver_LabelGetPoint.ID added |
---|
by , 15 years ago
Attachment: | BugMapserver_LabelGetPoint.IND added |
---|
by , 15 years ago
Attachment: | BugMapserver_LabelGetPoint.MAP added |
---|
by , 15 years ago
Attachment: | BugMapserver_LabelGetPoint.TAB added |
---|
by , 15 years ago
Attachment: | symbols.list added |
---|
comment:1 by , 15 years ago
Component: | MapServer C Library → MapScript-SWIG |
---|---|
Status: | new → assigned |