- if (tp->extended && (tp->fix_mode >= VIK_GPS_MODE_2D)) {
- if (!isnan(tp->course)) {
- gchar *s_course = a_coords_dtostr(tp->course);
- fprintf ( f, " <course>%s</course>\n", s_course );
- g_free(s_course);
- }
- if (!isnan(tp->speed)) {
- gchar *s_speed = a_coords_dtostr(tp->speed);
- fprintf ( f, " <speed>%s</speed>\n", s_speed );
- g_free(s_speed);
- }
- if (tp->fix_mode == VIK_GPS_MODE_2D)
- fprintf ( f, " <fix>2d</fix>\n");
- if (tp->fix_mode == VIK_GPS_MODE_3D)
- fprintf ( f, " <fix>3d</fix>\n");
- if (tp->nsats > 0)
- fprintf ( f, " <sat>%d</sat>\n", tp->nsats );
+ if (!isnan(tp->course)) {
+ gchar *s_course = a_coords_dtostr(tp->course);
+ fprintf ( f, " <course>%s</course>\n", s_course );
+ g_free(s_course);
+ }
+ if (!isnan(tp->speed)) {
+ gchar *s_speed = a_coords_dtostr(tp->speed);
+ fprintf ( f, " <speed>%s</speed>\n", s_speed );
+ g_free(s_speed);
+ }
+ if (tp->fix_mode == VIK_GPS_MODE_2D)
+ fprintf ( f, " <fix>2d</fix>\n");
+ if (tp->fix_mode == VIK_GPS_MODE_3D)
+ fprintf ( f, " <fix>3d</fix>\n");
+ if (tp->nsats > 0)
+ fprintf ( f, " <sat>%d</sat>\n", tp->nsats );
+
+ s_dop = NULL;
+ if ( tp->hdop != VIK_DEFAULT_DOP )
+ {
+ s_dop = a_coords_dtostr ( tp->hdop );
+ }
+ if (s_dop != NULL)
+ fprintf ( f, " <hdop>%s</hdop>\n", s_dop );
+ g_free ( s_dop ); s_dop = NULL;
+
+ if ( tp->vdop != VIK_DEFAULT_DOP )
+ {
+ s_dop = a_coords_dtostr ( tp->vdop );