1

I have a .shp with a road network that I want to represent in a Graph with NetworkX. I have used it for further analysis such as shortest distance etc. The problem is the function in Networkx converts shapefile to DiGraph only. The Digraphs are not suitable for representing multiple edges to same nodes

Is there any way to create a MultiDiGraph so I don't lose any edges, or a way around it?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 22, 2017 at 17:51

1 Answer 1

1

You could "manually" write your import function, instead of using write_shp() like mentioned in this answer to Counting number of lines connected to point? at "Creation of a Graph".

aldo_tapia
13.8k5 gold badges33 silver badges60 bronze badges
answered Aug 16, 2017 at 9:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.