55import xml .etree .ElementTree as ET
66
77from . import exif_read , exiftool_read , geo
8+ from .telemetry import GPSFix , GPSPoint
89
910
1011MAX_TRACK_ID = 10
@@ -87,7 +88,7 @@ def _aggregate_gps_track(
8788 alt_tag : T .Optional [str ] = None ,
8889 direction_tag : T .Optional [str ] = None ,
8990 ground_speed_tag : T .Optional [str ] = None ,
90- ) -> T .List [geo . PointWithFix ]:
91+ ) -> T .List [GPSPoint ]:
9192 """
9293 Aggregate all GPS data by the tags.
9394 It requires lat, lon to be present, and their lengths must match.
@@ -173,15 +174,16 @@ def _aggregate_float_values_same_length(
173174 if timestamp is None or lon is None or lat is None :
174175 continue
175176 track .append (
176- geo . PointWithFix (
177+ GPSPoint (
177178 time = timestamp ,
178179 lon = lon ,
179180 lat = lat ,
180181 alt = alt ,
181182 angle = direction ,
182- gps_fix = None ,
183- gps_precision = None ,
184- gps_ground_speed = ground_speed ,
183+ epoch_time = None ,
184+ fix = None ,
185+ precision = None ,
186+ ground_speed = ground_speed ,
185187 )
186188 )
187189
@@ -230,8 +232,8 @@ def _aggregate_gps_track_by_sample_time(
230232 ground_speed_tag : T .Optional [str ] = None ,
231233 gps_fix_tag : T .Optional [str ] = None ,
232234 gps_precision_tag : T .Optional [str ] = None ,
233- ) -> T .List [geo . PointWithFix ]:
234- track : T .List [geo . PointWithFix ] = []
235+ ) -> T .List [GPSPoint ]:
236+ track : T .List [GPSPoint ] = []
235237
236238 expanded_gps_fix_tag = None
237239 if gps_fix_tag is not None :
@@ -249,7 +251,7 @@ def _aggregate_gps_track_by_sample_time(
249251 gps_fix_texts = texts_by_tag .get (expanded_gps_fix_tag )
250252 if gps_fix_texts :
251253 try :
252- gps_fix = geo . GPSFix (int (gps_fix_texts [0 ]))
254+ gps_fix = GPSFix (int (gps_fix_texts [0 ]))
253255 except ValueError :
254256 gps_fix = None
255257
@@ -280,7 +282,7 @@ def _aggregate_gps_track_by_sample_time(
280282 for idx , point in enumerate (points ):
281283 point .time = sample_time + idx * avg_timedelta
282284 track .extend (
283- dataclasses .replace (point , gps_fix = gps_fix , gps_precision = gps_precision )
285+ dataclasses .replace (point , fix = gps_fix , precision = gps_precision )
284286 for point in points
285287 )
286288
@@ -355,7 +357,7 @@ def extract_model(self) -> T.Optional[str]:
355357 _ , model = self ._extract_make_and_model ()
356358 return model
357359
358- def _extract_gps_track_from_track (self ) -> T .List [geo . PointWithFix ]:
360+ def _extract_gps_track_from_track (self ) -> T .List [GPSPoint ]:
359361 for track_id in range (1 , MAX_TRACK_ID + 1 ):
360362 track_ns = f"Track{ track_id } "
361363 if self ._all_tags_exists (
@@ -397,7 +399,7 @@ def _all_tags_exists(self, tags: T.Set[str]) -> bool:
397399
398400 def _extract_gps_track_from_quicktime (
399401 self , namespace : str = "QuickTime"
400- ) -> T .List [geo . PointWithFix ]:
402+ ) -> T .List [GPSPoint ]:
401403 if not self ._all_tags_exists (
402404 {
403405 expand_tag (f"{ namespace } :GPSDateTime" ),
0 commit comments