Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Folium/Folium_Build_route_maps.ipynb
2973 views
Kernel: Python 3

Folium.jpg

Folium - Build route maps

Give Feedback | Bug report

Tags: #folium #maps #routes #python #visualization #data

Last update: 2023-07-31 (Created: 2023-07-31)

Description: This notebook will show how to use Folium to build route maps.

Input

Import libraries

try: import folium except: !pip install folium --user import folium

Setup variables

  • start_point: Starting point of the route

  • end_point: Ending point of the route

  • waypoints: List of waypoints to be included in the route

start_point = (48.85837009999999, 2.2944813) end_point = (48.85837009999999, 2.2944813) waypoints = [(48.85837009999999, 2.2944813), (48.85837009999999, 2.2944813)]

Model

Create route map

Long description of the function without break

# Create route map route_map = folium.Map(location=start_point, zoom_start=13) # Create route folium.PolyLine( locations=[start_point, end_point], color="red", weight=2.5, opacity=1 ).add_to(route_map) # Add waypoints for point in waypoints: folium.Marker(location=point).add_to(route_map)

Output

Display result

route_map