I am trying to use the graph-tool to perform a huge automated series of
path analyses as part of a commute-justice project I am working on. I am
very new to graph-tool and somewhat new to Python.
I have converted an ESRI shapefile of street centerlines in Los Angeles
County into a GT file using this short script:
- i think it creates a valid
graph-tool network. Prior to that conversion I made sure the
OpenStreetMap centerlines were split at all intersections.
Running the code below gives me INF as the output to the dist_map returned
from the shortest_path request.
What diagnostics might i try to check the traversal of my network?
Running this on the Shapefile used to create the GT, I am able to use QGIS
to produce the shortest_path - see screenshot attached.
[image: Screen Shot 2018-11-29 at 1.54.38 PM (2).png]
I'd be glad to post my GT file somewhere if others wanted to poke at this
Thank you in advance,
from graph_tool import util as gutil
from graph_tool import topology as gtopo
from graph_tool.all import *
g = Graph(directed=False)
vertex_geoid = g.vertex_properties["geoid"]
vertices = gutil.find_vertex(g, vertex_geoid, '060372760005003')
start_vertex = vertices
vertices = gutil.find_vertex(g, vertex_geoid, '060377019023041')
end_vertex = vertices
dist_map = gtopo.shortest_distance(g, source=start_vertex,
output of some data for verification:
<Vertex object with index '7783' at 0x7f91c35693f0>
<Vertex object with index '11265' at 0x7f91c35696f0>