Polyline Label Generation problem

Hi,
I have another problem, this time generating labels for polyline shapes. Labels work for point shapes but not for polyline. I’ve checked that I have the same number of shapes as I do entries in the .dbf file and looking at the data in the dbf it looks okay. Anybody encountered this before or have a solution?
Thanks

Trevor

Hello Trevor.

This is not an issue I am aware of, and if anything is perhaps an edge case, since I know that polyline labeling is working in general.

If you could post the code you use to set up labeling for this layer, and perhaps even provide the layer, we may be able to determine the issue.

Thank you, and Regards.
Jerry.

Hi Jerry,

This is what I’m using to generate the polyline labels:
shape->Labels->FontSize = 7;
shape->Labels->FontBold = 1;
shape->Labels->LineOrientation = tkLineLabelOrientation::lorHorizontal;
shape->Labels->set_FrameType(tkLabelFrameType::lfPointedRectangle);
shape->Labels->FrameVisible = true;
shape->Labels->Generate(L"[Name]" ,tkLabelPositioning::lpCentroid,false);
shape->Labels->Visible = true;

As I said, it works for point shapes but not polylines.
Thanks
Trevor

Hi Jerry,

here is the shapefile and associated files.
LNM.zip (524.9 KB)

Hi, I have the same problem. I have a polyline the represets a open polygon (not closed) and when I call Centroid function I get a error. Here is my code:
for i:=0 to shp.NumShapes-1 do begin
xlbl := shp.Shape[i].Centroid.x ; '<-- error
ylbl := shp.Shape[i].Centroid.y ;
lbltext := shp.CellValue[fieldIndex, i];
lblShp.AddLabel(lbltext, xlbl, ylbl, 0, 0 ,0,0); //cat red
end;