Select to view content in your preferred language

Allow turn-by-turn directions export from routes created using published AGOL/Portal network data service

287
5
08-26-2025 06:53 AM
Status: Needs Clarification
Labels (1)
SWATConsultingInc
Regular Contributor

It would be helpful if exporting of the turn-by-turn directions (i.e., the Directions tool) could be used for routes that were created using the ESRI/ArcGIS Online published data source. Running the tool already consumes credits and if you're running the Directions tool in Pro, you already need to buy the Network Analyst license. In other words, the user is already paying for this functionality, it would be helpful to extend it to exporting those turn-by-turns in plain text/CSV file. I am already aware this tool can only be run on routes that were generated using network data sources that are not ESRI published services.

5 Comments
MelindaMorang

You're correct that the Directions tool doesn't work when the network analysis layer uses a service as its network data source.  However, turn-by-turn directions are available.  You can print them from the Directions pane.  Or, if you want to do something more custom with them, you can access the DirectionPoints and DirectionLines feature classes in the feature dataset that stores the network analysis layer's data.

To find the feature dataset where the network analysis layer's data is stored:

  1. Open the properties of the network analysis layer by right-clicking or double-clicking in the Contents pane.
  2. Go to the Source page
  3. Go to the Analysis Data Source section
  4. Refer to the Database and Feature Dataset rows in the table.

You'll find the DirectionPoints and DirectionLines feature classes like this:

MelindaMorang_0-1756217576122.png

The schema of those feature classes is documented here (for Route): https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/route-output-data-types.htm#ESRI_SECT...  (I know this is the arcpy.nax documentation, but it's the same schema.)  The other solvers that support directions have a nearly identical schema, with some minor differences in the ID fields that refer back to the original inputs.

Does this serve your needs?  If not, please let us know specifically which features of the Directions tool you would like to see implemented (which output type, etc.).

MelindaMorang
Status changed to: Needs Clarification
 
SWATConsultingInc

Hi Melinda

Thanks for the response. I had already found the same tool/workaround you described. I was able to find the Route Solver directions and points route components that were created using the published service. For my attempt, I generated 6 routes between 6 unique Origin/Destination pairs.
 
I work better in Excel so I copied/pasted these tables into Excel to try and manipulate them into outputs that are aligned closer to Google Maps directions (with the direction, distance and time for each step).
 
I created a new field in both tables as a combo of the Route ID and Sequence ID fields. I did this because although the directions and azimuths are inside the Route Solver points layer, the distance the user must travel (in meters and minutes) at each step are inside the lines layer. 
 
I was able to join the two tables together, although there were some instances where the Route ID/Segment ID unique field didn't join; this seemed to be where the "Direction Point Type" was in the 1000s. According to the webpage you sent these represent 1000 (General Event), 1001 (Landmark) and 1006 (Restriction Violation). I can filter these out since they're not important for our turn-by-turns.
 
The final step would be combining the Display Text, with the Meters, the Minutes, and a bearing into one combined "step". Then grouping these steps by Route Name so they are consolidated into one output.
 
Grace at ESRI provided these steps for converting the Aziumeth to bearings:
 
As you can see, there is a lot of manual work required to format the directions, and then doing this on a batch of ~500-1000 routes would be quite tedious.
 
Is there any way you could send me an example of the text output that the "Directions" tool creates if a local network is used as a data source as opposed to the published ESRI service? I'd like to see how they compare to a Google Maps output and see if it's worth trying to create a local network data source from the Ontario road network (this is where our project area is) and use this to generate Directions instead of the published ESRI service.
 
My original post idea came up because if a user pays for a network analyst license and pays for the routing tool to run in Pro (it consumes credits), it is unfortunate that the Directions tool is limited to only routes created from a local network source. In this case, it would be helpful if paying for the tool could limit the amount of manual prep and steps required by the user.
MelindaMorang

From your description, I highly doubt the Directions geoprocessing tool is going to give you the output you need.  It's not really machine readable, so unless it gives you exactly what you want, it's unlikely to be usable.  You can download some network datasets from our Pro tutorial data here and give the tool a try yourself: https://links.esri.com/NetworkAnalyst/TutorialData/Pro

The Directions geoprocessing tool was created a very long time ago and utilizes an earlier way of generating directions that is more or less deprecated, at least internally.  It doesn't use the new directions engine under the hood, which generates the DirectionPoints and DirectionLines feature classes.  Those feature classes (the newer-style directions) are the only directions information we get back from services.  We don't have the older style directions information available to us, so we can't support the Directions tool when solving against a service.  It is extremely unlikely that we would ever make any updates to that tool to support this.

It sounds like you have very specific needs for the output text and format for your turn-by-turn directions.  I think coming up with an automated process for post-processing DirectionPoints and DirectionLines will be your best bet.  The calculations you mentioned seemed straightforward enough.  If you can implement them using the Calculate Field tool or something like that, you could run them in a Python script or model.

Another option is to use our custom directions functionality in the arcpy.nax module: https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/custom-directions.htm.  This allows you to customize the directions maneuver text as it's being generated, although this only works if you have a local network dataset and not a service.

 

SWATConsultingInc

Thank you Melinda, you've given me a lot to consider and I appreciate the additional links.