# Calulating number of turns along a route

895
14
04-25-2012 03:00 PM
New Contributor II
Hello,

I'm am using NA's Closest Facility solver to calculate routes between incidents and the closest fire station. The processes works fine and I have about 385 different routes. Is it possible to calculate or find out the number of turns along each route? And better yet, whether it was a left or right turn? Any help would be greatly appreciated.

Thanks!
Tags (2)
14 Replies
Esri Regular Contributor
What are your goals? Is it know the number of turns (define turn!)?
That is, is it to know left/right turns only when street name changes? Or is it to know bends or turns in the road even when the street name does not change?

At a minimum, you could export the directions and count how many "left" and "right" words are contained in it!
Jay Sandhu
New Contributor
Hi Jay,
My goal is to count number of left and right turns in a route and turns should be made at an intersections. If nothing works out, I was thinking to read the XML file to get count of "left" and "right" words. Btw, how does ArcGIS decide left and right turns?

Thanks,
Nagendra
New Contributor
Also, do you know how to read A XML file, i am having difficulty in doing that. I am using following for this:

`Dim xmlStream As esriSystem.IXMLStreamDim xmlReader As esriSystem.IXMLReaderSet xmlStream = New esriSystem.xmlStreamxmlStream.LoadFromFile "D:\Directions.xml"Set xmlReader = New esriSystem.xmlReaderxmlReader.ReadFrom xmlStream`

I don't know what to do after this. However, I tried several methods of IXMLReader but couldn't get anything working.

Thanks,
Nagendra
New Contributor
Hi,
I am also annoying to find no. of turns (left and right) the length of a route. But I have ArcGIS 9.3, and I guess, this add-in is for ArcGIS 10 as it doesn't identify 9.3. So, it would be accommodating for me if anyone can please post the VBA code linked with the add-in?
Also, I know that turns can be access via traversal but when I use that with my network data set it gives me a blank shapefile, however, junctions and limits output are completely fine. That left me wondering if it has anything to do with the way I set up my turns while create the network dataset. That time, I checked "Yes" to the question "Do you want to model turns in this network?" with "Global turns" checkered as the turn source. Also, at the end, I recognized driving instructions by just as long as "Street Name Fields". Alternatively, I tried using INAStreetDirectionsAgent, but it gives me the directions in XML output. I couldn't find any other useful output from that. Even, with the XML output I don't know how to use it to get the number of turns�?��?��?��?��?��?��?��?��?��?��?��?��?��?��?�..
Esri Regular Contributor