I think this problem is happening because the GetLineOnALine API returns back an invalid lineshape , for example, it does not contains any points in it. I did some investigations on the logic of GetLineOnALine API and found that this will always be happening if the passed in two points referred to the same closest point shape in the lineShape.
Any more questions or concerns please do not hesitate to let me know, and Happy New Year 2011!
Thanks for your reply, Yale Sorry, I still don’t understand clearly. please you explain more.And I how to do it? If I’d like to calculate the distance of two points in the line.
I think Yale’s reply said that the result of lineShape.GetLineOnALine(TnodePointShape, GisPointShape) is a empty lineShape, so you can not get length from it, the reason is that your orginal lineshape is two small, all the input points will find the same vertex, so like you pass in two points which the same coordinate, obviously the result is empty line.
You can enlarge your line shape and try again, you can understand what Yale said.