Be able to create network analyst travel mode with Python

3459
14
09-24-2024 09:16 AM
Status: In Product Plan
d484648
Occasional Contributor

Create the necessary methods and classes to support defining a network dataset travel mode with Python

14 Comments
MDKaller

Okay, regarding my last post, please disregard that.  I believe I figured it out.

MelindaMorang
Status changed to: Under Consideration

We are working on a project that will help users transfer travel modes from one network dataset to another, and I believe the components of that project will satisfy the needs expressed here.  When we complete this project, I'll report back here, hopefully with a code sample.

d484648

Excellent!

MelindaMorang
Status changed to: In Product Plan
The forthcoming Pro 3.7 release will include some new tools and Python commands you can use to create or modify network dataset travel modes programmatically using Geoprocessing tools and/or standalone Python.
 
  • Export Network Travel Modes (geoprocessing tool) - Exports a network's travel modes to a JSON file.
  • Replace Network Travel Modes (geoprocessing tool) - Replaces a network's current travel modes with the ones defined in the input JSON file, which can be created manually (or programmatically) or via the Export Network Travel Modes tool.
  • The arcpy.nax.NetworkDataset class's updateNetworkDatasetSchema() method has a new parameter, travel_modes, which allows you to set travel modes on a network dataset directly in Python.
In all the above functionality, travel modes are defined using a well-known, documented JSON structure.
 
I'll post documentation for all of the above when it becomes publicly available after the release.