Not able to get route in OSMNX
I have been trying to get routes for Moscow, Russia, but for two destination graph shows the same node. What i do:
import networkx as nx
import osmnx as ox
import requests
import matplotlib.cm as cm
import matplotlib.colors as colors
ox.config(use_cache=True, log_console=True)
ox.config(overpass_endpoint='https://lz4.overpass-api.de/api/interpreter')
print(ox.__version__)
place = {'city' : 'Moscow',
'country' : 'Russia'}
G = ox.graph_from_place(place, network_type='drive')
G_projected = ox.project_graph(G)
ox.save_graphml(G_projected, filename='NewnetworkDrive.graphml')
G = ox.load_graphml('NewnetworkDrive.graphml')
# get the nearest network node to each point
orig_node = ox.get_nearest_node(G, (55.754715, 37.583251))
dest_node = ox.get_nearest_node(G, (55.753994, 37.656282))
route = nx.shortest_path(G, orig_node, dest_node, weight='time')
fig, ax = ox.plot_graph_route(G, route, node_size=0)
This is what i get as a result:
And when i try to calculate distance i get zero:
nx.shortest_path_length(G, orig_node, dest_node, weight='length')
I use osmnx 0.11.4 on MacOS.
What should i do to calculate routes? I do everything like in example notebooks.