Skip to content

Instantly share code, notes, and snippets.

@deparkes
Last active May 2, 2016 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deparkes/610b112f74eadbda663806ba8dd83069 to your computer and use it in GitHub Desktop.
Save deparkes/610b112f74eadbda663806ba8dd83069 to your computer and use it in GitHub Desktop.
import gpxpy
import gpxpy.gpx
import folium
gpx_file = open('my_gpx_coords.gpx', 'r')
gpx = gpxpy.parse(gpx_file)
points = []
for track in gpx.tracks:
for segment in track.segments:
for point in segment.points:
points.append([point.latitude, point.longitude])
# Load map centred on London
uk = folium.Map(location=[51.5170595,-0.0910127], zoom_start=15)
#add a marker for each toilet
for each in points:
folium.Marker(each).add_to(uk)
# Save map
uk.save("./gpx_example.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment