With OSMnx, I would like to be able to save a path with its curvature as the image below shows.
import osmnx as ox
import networkx as nx
# Download the road network
G = ox.graph_from_place('Monterey, California', network_type='drive')
# Starting and ending point of a trip
start = [36.580665,-121.8297467]
end = [36.594319,-121.8727587]
# Retrieve nearest node
orig_node = ox.get_nearest_node(G, start)
dest_node = ox.get_nearest_node(G, end)
# Compute the path of the trip
route = nx.shortest_path(G, orig_node, dest_node, weight='length')
# Plot the trip
fig, ax = ox.plot_graph_route(G_projected,
route,edge_linewidth=1,
node_size=20,
fig_height=20,route_linewidth=10)
Obviously, I can save the route python list but I will lost the curvature of the path since route list contains fewer nodes. Is it possible to save the displayed red route in Google polyline format or something like that in order to conserve its curved shape?