Shortest Path / Distance

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.


I'd be glad to post my GT file somewhere if others wanted to poke at this

Thank you in advance,

Cord Thomas


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[0]

vertices = gutil.find_vertex(g, vertex_geoid, '060377019023041')

end_vertex = vertices[0]

dist_map = gtopo.shortest_distance(g, source=start_vertex,
target=end_vertex, weights=g.edge_properties['weight_dist'])


returns inf

output of some data for verification:


<Vertex object with index '7783' at 0x7f91c35693f0>


<Vertex object with index '11265' at 0x7f91c35696f0>





attachment.html (8.59 KB)