How can I keep the milisecond part if I use gpxpy to parse it?
If I run the code below
import gpxpy
import gpxpy.gpx
# Parsing an existing file:
# -------------------------
gpx_file = open('sample.gpx', 'r')
gpx = gpxpy.parse(gpx_file)
for track in gpx.tracks:
for segment in track.segments:
for point in segment.points:
print('Point at ({0},{1}) -> {2} Time is {3}'.format(point.latitude, point.longitude, point.elevation, point.time))
for waypoint in gpx.waypoints:
print('waypoint {0} -> ({1},{2})'.format(waypoint.name, waypoint.latitude, waypoint.longitude))
for route in gpx.routes:
print('Route:')
for point in route.points:
print('Point at ({0},{1}) -> {2}'.format(point.latitude, point.longitude, point.elevation))
I get those
Point at (47.4973805,18.8395458) -> 242.0 Time is 2017-08-08 18:35:56
Point at (47.4974565,18.8394014) -> 242.0 Time is 2017-08-08 18:35:57
Point at (47.4974565,18.8394014) -> 242.0 Time is 2017-08-08 18:35:57
Point at (47.4974566,18.8394013) -> 241.8 Time is 2017-08-08 18:35:58
Point at (47.4974566,18.8394012) -> 241.6 Time is 2017-08-08 18:35:58
with the milisecond part of the original timestamp lost
I have sample gpx file like this
How can I keep the milisecond part if I use gpxpy to parse it?
If I run the code below
I get those
with the milisecond part of the original timestamp lost