@@ -87,7 +87,7 @@ def _aggregate_gps_track(
8787 alt_tag : T .Optional [str ] = None ,
8888 direction_tag : T .Optional [str ] = None ,
8989 ground_speed_tag : T .Optional [str ] = None ,
90- ) -> T .List [geo .PointWithFix ]:
90+ ) -> T .List [geo .GpsPoint ]:
9191 """
9292 Aggregate all GPS data by the tags.
9393 It requires lat, lon to be present, and their lengths must match.
@@ -173,7 +173,7 @@ def _aggregate_float_values_same_length(
173173 if timestamp is None or lon is None or lat is None :
174174 continue
175175 track .append (
176- geo .PointWithFix (
176+ geo .GpsPoint (
177177 time = timestamp ,
178178 lon = lon ,
179179 lat = lat ,
@@ -182,6 +182,7 @@ def _aggregate_float_values_same_length(
182182 gps_fix = None ,
183183 gps_precision = None ,
184184 gps_ground_speed = ground_speed ,
185+ unix_timestamp_ms = int (timestamp * 1000 ),
185186 )
186187 )
187188
@@ -230,8 +231,8 @@ def _aggregate_gps_track_by_sample_time(
230231 ground_speed_tag : T .Optional [str ] = None ,
231232 gps_fix_tag : T .Optional [str ] = None ,
232233 gps_precision_tag : T .Optional [str ] = None ,
233- ) -> T .List [geo .PointWithFix ]:
234- track : T .List [geo .PointWithFix ] = []
234+ ) -> T .List [geo .GpsPoint ]:
235+ track : T .List [geo .GpsPoint ] = []
235236
236237 expanded_gps_fix_tag = None
237238 if gps_fix_tag is not None :
@@ -298,21 +299,21 @@ def __init__(
298299 self ._texts_by_tag = _index_text_by_tag (self .etree .getroot ())
299300 self ._all_tags = set (self ._texts_by_tag .keys ())
300301
301- def extract_gps_track (self ) -> T .List [geo .Point ]:
302+ def extract_gps_track (self ) -> T .List [geo .GpsPoint ]:
302303 # blackvue and many other cameras
303304 track_with_fix = self ._extract_gps_track_from_quicktime ()
304305 if track_with_fix :
305- return T . cast ( T . List [ geo . Point ], track_with_fix )
306+ return track_with_fix
306307
307308 # insta360 has its own tag
308309 track_with_fix = self ._extract_gps_track_from_quicktime (namespace = "Insta360" )
309310 if track_with_fix :
310- return T . cast ( T . List [ geo . Point ], track_with_fix )
311+ return track_with_fix
311312
312313 # mostly for gopro
313314 track_with_fix = self ._extract_gps_track_from_track ()
314315 if track_with_fix :
315- return T . cast ( T . List [ geo . Point ], track_with_fix )
316+ return track_with_fix
316317
317318 return []
318319
@@ -355,7 +356,7 @@ def extract_model(self) -> T.Optional[str]:
355356 _ , model = self ._extract_make_and_model ()
356357 return model
357358
358- def _extract_gps_track_from_track (self ) -> T .List [geo .PointWithFix ]:
359+ def _extract_gps_track_from_track (self ) -> T .List [geo .GpsPoint ]:
359360 for track_id in range (1 , MAX_TRACK_ID + 1 ):
360361 track_ns = f"Track{ track_id } "
361362 if self ._all_tags_exists (
@@ -397,7 +398,7 @@ def _all_tags_exists(self, tags: T.Set[str]) -> bool:
397398
398399 def _extract_gps_track_from_quicktime (
399400 self , namespace : str = "QuickTime"
400- ) -> T .List [geo .PointWithFix ]:
401+ ) -> T .List [geo .GpsPoint ]:
401402 if not self ._all_tags_exists (
402403 {
403404 expand_tag (f"{ namespace } :GPSDateTime" ),
0 commit comments