From d9cfb035b89f060ea45cab2f2d2b70f20862d0aa Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Tue, 9 Feb 2016 09:00:31 +0100 Subject: [PATCH] GPX output now contains elevation and UTC time --- storage.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/storage.c b/storage.c index fed1531..b146dd5 100644 --- a/storage.c +++ b/storage.c @@ -999,7 +999,8 @@ char *gpx_string(JsonNode *location_array) // json_foreach(one, location_array) { - double lat = 0.0, lon = 0.0; + double lat = 0.0, lon = 0.0, alt = 0.0; + char *isotst = ""; JsonNode *j; if ((j = json_find_member(one, "lat")) != NULL) { @@ -1010,7 +1011,14 @@ char *gpx_string(JsonNode *location_array) lon = j->number_; } - utstring_printf(xml, " \n", lat, lon); + if ((j = json_find_member(one, "alt")) != NULL) { + alt = j->number_; + } + if ((j = json_find_member(one, "isotst")) != NULL) { + isotst = j->string_; + } + + utstring_printf(xml, " %.2f\n", lat, lon, alt, isotst); } utstring_printf(xml, "%s", " \n\n\n");