Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have code which analyzes multipart polylines (roads) from the beginning towards the end. The algorithm "moves along" the road.

My multipart polylines include circular junctions and branches so they can't be represented by simple polylines. The problem is that when my code proceeds along the multipart polyline, it jumps from one part to the the other, completely remote part. Since my code uses "GetSubcurve" method, I thought defining consecutive order of parts would solve my problem. Even though I created multipart polylines by adding geometries in desired order (in python), the problem still exists. I appreciate your suggestions,

share|improve this question
I think the FHWA HSIS strip analysis tool deals with this. If source code is provided you might look to see how they do it. – Kirk Kuykendall Oct 13 '11 at 12:50

1 Answer 1

Ah yes, I have had to do this several times. What I usually do is build a topology, split on a vertex (because the ESRI concept of edges can loop back to themselves) and splitting gurantees that you will not have a loopback condition, and then walk those sub edges, constantly looking at the From and To Nodes in the ITopologyEdge to figure out if my incoming node matches the from node. If it doesnt, I flip it, and continue. Not fun, but works.

share|improve this answer
Finnaly, I have solved the problem. All attempts inside the geoprocessing (arcgisscripting) failed even if I constructed compeletely new objects from scratch setting vertices' coordinate values. So, I resorted to Osgeo.ogr library to create new shape file. The data had been imported using WKT data format (mustilinestring). The order defined in WKT format was preserved in the newly created multipart polylines. Thank you, – Matej Oct 18 '11 at 6:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.