+def print_parsed_file(filename):
+
+ gpx = pygpx.GPX()
+ gpx.ReadFile(filename)
+
+ for track in gpx.tracks:
+
+ try:
+ author = gpx.author
+ except:
+ author = None
+
+ try:
+ name = gpx.name
+ except:
+ name = None
+
+ start = track.start()
+ if start:
+ printable = pygeocode.GeoName(start.lat,start.lon).printable
+ start_time = track.start_time()
+ full_duration = track.full_duration().total_seconds()
+ distance = track.distance()
+ filtered_distance = track.filtered_distance(max_speed=50)
+ ascent = track.elevation_gain()
+ descent = track.elevation_loss()
+ ((minlat,minlon),(maxlat,maxlon)) = track.bound_box()
+ params = (
+ gpx.author,name,filename.decode('UTF-8'),
+ track.sport,start_time,full_duration,
+ distance,filtered_distance,ascent,descent,
+ start.lat,start.lon,
+ printable,
+ minlat,minlon,maxlat,maxlon
+ )
+ print(params)