If you want to add center coordinate of line to a point.shp with roadid, the point.shp must already has roadid column. And if you want to get center coordinate of each line, you can call lineShape.GetCenterPoint(), you don’t need calculate by yourself.
And you said the code can’t run, what’s that mean? Is there any exception throw? Can you tell me what message it throw?
I don’t have point.shp and road.shp, so I can’t recreate your problem. Please give me more information to help solve problem.
the follows code can’t run, it shows errow message:
it can’t change ObjectType of ‘ThinkGeo.MapSuite.Core.MultilineShape’ to ObjectType of ‘System.Collections.Generic.IEnumerable`1[ThinkGeo.MapSuite.Core.LineShape]’。
Dim features As New Collection(Of Feature) For i As Integer = 0 To NointerList.Count - 1 features = r_originalShapeFileFeatureLayer.QueryTools.GetFeaturesByColumnValue(“roadid”, NointerList(i)) Next
Dim shapeCollect As New Dictionary(Of String, MultilineShape) For i As Integer = 0 To features.Count - 1 shapeCollect.Add(NointerList(i), New MultilineShape(features.Item(i).GetShape() Next
The exception message is obviously, when you new a MultilineShape, you need input a 'System.Collections.Generic.IEnumerable`1[ThinkGeo.MapSuite.Core.LineShape]', but you input a 'ThinkGeo.MapSuite.Core.MultilineShape' because the result of features.Item(i).GetShape() is a MultilineShape.
If you want to solve this problem, you have two ways:
1, input a collection which contains lineShapes not multilineShape,
2, use another overload constructor, you can input well known text or well know binary.