How to plot in edges and routes on the same folium in osmnx

117
April 15, 2022, at 04:20 AM

I'm trying to plot edges and routes in an interactive map by using: ox.plot_graph_folium or ox.plot_routes_folium.

# plot the street network with folium
m1 = ox.plot_graph_folium(G, popup_attribute="name", weight=2, color="#8b0000")

I can plot the edges or routes separately, However, is there any way I can plot the edges and routes on the same grape? This is my ideal output:

Answer 1

According to the documentations: plot_graph_folium has the parameter graph_map, which is a folium.folium.Map object. As well, plot_route_folium has the parameter route_map, which is a folium.folium.Map object. For both of these parameters the docs state:

if not None, plot on this preexisting folium map object

So you simply need to call one of these methods and take the returned folium map, e.g. your m1, and pass it to the respective parameter while calling the other method.

Rent Charter Buses Company
READ ALSO
Capturing stdout result of `flutter test integration_test`

Capturing stdout result of `flutter test integration_test`

For CI, I need to write a program that runs flutter test integration_test and captures the stdout resultIn python the code would be:

95
Replace a pattern in column of a csv file using Python

Replace a pattern in column of a csv file using Python

I am looking for some help with editing CSV in pythonI have a file in below format

128
Making animation on matplotlib of graph with Networkx efficiently

Making animation on matplotlib of graph with Networkx efficiently

I am trying to animate a graph whose edges widths and color change over timeMy code works, but it is extremely slow

121
Random sampling in python3

Random sampling in python3

Suppose I have two lists A = [1,2,3,4] and B=[a,b,c,d]I have to do random sampling such that my new list could look like this C= [1 or a , 2 or b , 3 or c , 4 or d], there is also a constrain that that the list C should have 50 % data from both A and B

89