ThinkGeo.com    |     Documentation    |     Premium Support

Dynamic Segmentation Example

I noticed you have a dynamic segmentation example available in the code community.  This is quite interesting to me as we work in the pavement management sector.    We need to be able to select a point on a road and then highlight that road for a given number of miles.  However, your example covers 1 multiline and if I understand the data correctly a road can consist of 100's of multilines.  How would you string them together to highlight say 10 miles of a given road?


Thanks, if this is a question I need to ask in the customer support portal please let me know.


Thanks.


Curtis



Curtis,


This logic is somehow complex. Hopefully my following answers can give you some hints or help.
 
1)      Basically the idea is to “Merge” the lines into a longer “Multiline” , then based on it call the GetLineOnALine API to get the result.
 
For example, in following Road, Road A \ Road C \ Road D are all 5 miles, while you want to get a Line from RoadA StartPoint which is 12 miles. You have to create a “Virtual multiline” which combines with RoadA & RoadC & RoadD.
 
targetMultLine.Lines.Add(RoadA);
targetMultLine.Lines.Add(RoadC);
targetMultLine.Lines.Add(RoadD);
 
After that, you can say as following:

MultilineShape result = (MultilineShape) targetMultLine.GetLineOnALine(StartingPoint.FirstPoint, startDistance, Distance, GeographyUnit.Meter, DistanceUnit.Meter);

 
2) The most difficult part is to create the targetMultiLine shown above. When we create this, we should add those lines by sequence, this is most important part. Somehow, it depends on data, some data stores them in sequence, while some data are not.

 
If I am not clear enough, just feel free to let me know.
 
Thanks.
 
Yale

 



Yale,


This has always been the problem that I struggle with, determining which multilines are part of the same highway.  There seems to be no easy way to do this nor does there seem to be a difficult programmatic way to do this unless I am really missing something.  You can go around and around with the intersections, etc. but there still seems to be no way to determine if you are grabbing the right multilines to combine together.


Thanks.


Curtis



Curtis, 
  
 For this problem, it seems that our newly product Routing can deal with it very easily. 
  
 For more information, you can visit our website or contact our supports. 
  
 Any more questions feel free to let me know. 
  
 Thanks. 
  
 Yale