Note
Go to the end to download the full example code
Track colored by velocity
This example will create a map and color the track according to the velocity.
Note
The velocities are calculated from the distance so it is a bit noisy.
from gpxplotter import add_segment_to_map, create_folium_map, read_gpx_file
line_options = {"weight": 8}
the_map = create_folium_map(tiles="openstreetmap")
for track in read_gpx_file("example2.gpx"):
for i, segment in enumerate(track["segments"]):
add_segment_to_map(
the_map,
segment,
color_by="velocity-level",
cmap="RdPu_09",
line_options=line_options,
)
# To store the map as a HTML page:
# the_map.save('map_003.html')
# To display the map in a Jupyter notebook:
the_map
Total running time of the script: (0 minutes 0.464 seconds)