As far as my understanding, the GetPointOnALine API should fix your problem; the key part is passing correct distance which is calculated from the first point of the LineShape. As your example, when you want to get the second vertex, you probably need to 4 meters (2 m + 2m), hopes that make sense. Any more questions please feel free to let me know.
If we want the midpoint( vertex )of the Line. and display that vertex on the line how can we do that? i have calcuted route and pass that route(multiline) to GetPointOnALine to find the midpoint (vertex) of the route. but i dosent give me the point.
RoutingEngine routingEngine = new RoutingEngine(routingSource, GetAlgorithm(), featureSource);
For the GetPointOnALine, first user pass in a StaringPoint type, which means calculate from the first vertex or from the last vertex, and then passing the percentage of line(you are using this way) or pass in the percentage length with map unit, distance unit together, if you are using the first way, we will default consider the map unit and distance unit as Meter, so if your data are not meter, it maybe some error.
Also, GetPointOnALine method only get the point, not create the point, that’s means if your point only have two vertex or don’t have a vertex that fit your distance condition, it’s possible return nothing to you.
Thanks Gray, But my map unit is decimal degree (same my shapefile has decimal degree). if i converted my map unit in meters shape file cannot display and if i converted my shapefile in meters then .rtg file cannot created.
so what is the solution of this problem.
kindly explain this " that's means if your point only have two vertex or don't have a vertex that fit your distance condition, it's possible return nothing to you. "
So for your situation, you can choose two ways to do this: LineShape l = new LineShape(); //set a percentage of line. l.GetPointOnALine(StartingPoint.FirstPoint, 50); //know a certain distance in the real world, like 100 kilometer. l.GetPointOnALine(StartingPoint.FirstPoint, 100, GeographyUnit.DecimalDegree, DistanceUnit.Kilometer);
Then, " that's means if your point only have two vertex or don't have a vertex that fit your distance condition, it's possible return nothing to you. " if lineshape l only have two points(start point and end point), and you set the percentage 50, so there is no point exist in the middle of line, it will reture nothing. if lineshape l are 200 kilometer long and only have two points, it will return nothing to you.