ThinkGeo.com    |     Documentation    |     Premium Support

DistanceAlongCurve

Dear support,


I am an ESRI client for now and I'm testing MapSuite 3.0.


I need to know if there are a easy way to measure a distance along a polilyne.


So I have a Feature that is a polilyne and I have a couple of points in that Polilyne.


This is how I got the Points:



MultipointShape



 overlapPointShape = currentMultilineShape.GetCrossing(areaBaseShape);

How can I find the distance between each of my points and the begining of the Polilyne (in Meters).


Regards,


André


 


 




This is one possible solution:


Get the point representing the beginning of your line by calling lineShape.GetPointOnALine(StartingPoint.FirstPoint, 0).


Then just get the distance by calling GetDistanceTo on the starting point and passing in your point.


PointShape startingPoint = lineShape.GetPointOnALine(StartingPoint.FirstPoint, 0); 
double distance = startingPoint.GetDistanceTo(crossPoint, map.MapUnit, DistanceUnit.Meter); 



Miguel,


Thanks for your post and interests in MapSuite component, welcome you to ThinkGeo Mapsuite Destkop discussion forum.
 
Also, Thanks for your sharing , Chad. I am a little disagree with your solution because requirement from Miguel is getting the distance along a polyline instead of getting the distance between two points directly.
 
Following is some code snippet of my opnion, maybe not correct either:).

LineShape targetLineShape;
LineShape tempLine = targetLineShape.GetLineOnALine(StartingPoint.FirstPoint, crossPoint);
double crossPointDistance = tempLine.GetLength(GeographyUnit.DecimalDegree, DistanceUnit.Meter);

 
If you have any more good suggestions just feel free to let it out.
 
Thanks.
 
Yale

It work Fine 
  
 Thanks Yale and Chad 
  
 Miguel

Miguel, 
  
 Thanks for letting me know your status. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale