Last active
March 17, 2018 21:32
-
-
Save Chandler/ea316d6b6b36fafe5740606fb39388de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gpxpy | |
def load_gpx_file(path): | |
gpx = gpxpy.parse(open(path, 'r')) | |
points = [] | |
for track in gpx.tracks: | |
for segment in track.segments: | |
for point in segment.points: | |
points.append([point.longitude, point.latitude]) | |
return points | |
path = "20150216-203314-Ride.gpx" | |
for point in load_gpx_file(path): | |
print point | |
# > | |
# [-122.422181, 37.767837] | |
# [-122.422185, 37.767878] | |
# [-122.422189, 37.767917] | |
# [-122.422193, 37.767958] | |
# [-122.422197, 37.767999] | |
# [-122.422201, 37.768034] | |
# [-122.422205, 37.768072] | |
# [-122.422212, 37.768137] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment