Select to view content in your preferred language

Network analysis in Python

6681
16
02-23-2015 02:35 PM
MatthiasBuehler
Deactivated User

Hi,

I'd like to automate the following tasks completely in Python. Can somebody provide me with some introductory code ?

1) Define a street network in a GDB ( actually also create the street features in Python based on other data)

2) Take that street network as the network analysis base

3) Define a start point and end point of a route ( do these points have to be exactly ON the network line ?)

4) Run the analysis

5) Print out in the console how long it would take to walk that distance (at a certain speed)

A very simple example with 3 imaginary streets would be very helpful.

Any input welcome!

Thanks,

Matt

0 Kudos
16 Replies
MelindaMorang
Esri Regular Contributor

The Build Network tool is the final step in network dataset editing or creation.  After you've edited the source features or updated the network dataset properties (which has to be done manually), you have to run the Build Network tool in order for those changes to really take effect in the network.

So no, this tool doesn't do everything you want to do, but you will still need this tool as the final step in your procedure.

0 Kudos
MatthiasBuehler
Deactivated User

Hi Melinda,

thanks for the input.

okay, then back to the question about the timeframe for this to be implemented.

if every other step is possible, that should be too, right ?

please let me know.

matt

0 Kudos
MelindaMorang
Esri Regular Contributor

I wasn't sure what you were referring to when you asked about the timeframe for "this" to be implemented.  Are you referring to the ability to create and/or edit network dataset properties in python?  If so, I can't answer that question except to say that we have no definitive plans to provide that functionality at this time.  We are aware that many users want this functionality, however.  It's on our radar.

0 Kudos
MatthiasBuehler
Deactivated User

hi,

yes, I referred to creating and editing network datasets and their properties in python.

ok, good to see I'm not the only one that would like this.

thanks!

matt

0 Kudos
LukeSussex1
New Contributor

 

Matthias Buehler‌ did you get anywhere with this? 

Melinda Morang‌ Have there been any advancements in the ability to edit network dataset properties such as group connectivity using python? It is something I would like to do.

Thanks, 

Luke

0 Kudos
MatthiasBuehler3
Regular Contributor

Hi Luke,

I haven't heard back, but I also never dove back into this topic. Maybe it's implemented meanwhile, it's been 5 years. 😉

Cheers,

matt

matthias buehler | founder & CTO | msc arch eth zurich

 vrbn studios AG | winterthurerstrasse 53 | 8610 uster | switzerland

+41 78 930 04 07 | matthias.buehler@vrbn.io | @vrbnio @mattb3d | www.vrbn.io

 official ESRI partner | channel sponsor of MH Tutorials on youtube | member of the visual effects society | artstation

0 Kudos
MelindaMorang
Esri Regular Contributor

It is not possible to edit network dataset properties in python, and that capability is not planned, either.  However, since this was originally posted, it is possible to create a network dataset in python with a pre-defined schema using the Create Network Dataset From Template tool.  If you can configure your network dataset manually once so it has the desired properties, you can create a template from it, and then you can automatically re-create this same network with the same properties with different input data (as long as it has the same schema).