Skip to content

Commit

Permalink
Fix KML gen if GPSTime is invalid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Diamond committed Oct 14, 2023
1 parent 7ff24fd commit f8f83df
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/examples/extract_position_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@
# typically precise. When analyzing position performance compared with another device, we strongly recommend
# that you do the performance using ellipsoid heights. When comparing in MSL, if the geoid models used by the
# two devices are not exactly the same, the heights may differ by multiple meters.
f.write(KML_TEMPLATE %
{'timestamp': '\n'.join([str(pose.gps_time.as_utc().isoformat())]),
'solution_type': int(pose.solution_type),
'coordinates': '\n'.join(['%.8f,%.8f,%.8f' % (pose.lla_deg[1], pose.lla_deg[0], pose.lla_deg[2] - pose.undulation_m)])})
#
# Only write KML entries with valid GPS time.
if pose.gps_time.as_utc() is not None:
f.write(KML_TEMPLATE %
{'timestamp': '\n'.join([str(pose.gps_time.as_utc().isoformat())]),
'solution_type': int(pose.solution_type),
'coordinates': '\n'.join(['%.8f,%.8f,%.8f' % (pose.lla_deg[1], pose.lla_deg[0], pose.lla_deg[2] - pose.undulation_m)])})

f.write(KML_TEMPLATE_END)

Expand Down

0 comments on commit f8f83df

Please sign in to comment.