I'm trying to convert a shapefile of only line geometry (a street network) to a NetworkX graph to run some connectivity algorithms on it. I'm running into this issue:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/networkx/readwrite/nx_shp.py", line 69, in read_shp for lyr in shp: TypeError: 'NoneType' object is not iterable
It seems to be an issue with the ogr module the fcn requires, but I believe (?) I downloaded it, and it doesn't raise the exception error written in the source code. Any ideas?
EDIT: here's my code snippet: import networkx as nx
print 'nx imported' G=nx.DiGraph() G=nx.read_shp('shpfile.shp', \ simplify = False) print "running fine"
It gets stuck at the read_shp() and doesn't run the print command at the end to confirm it's running correctly.