mirror of
https://github.com/owntracks/recorder.git
synced 2024-11-15 18:08:28 -07:00
GPX output now contains elevation and UTC time
This commit is contained in:
parent
291c920e99
commit
d9cfb035b8
12
storage.c
12
storage.c
@ -999,7 +999,8 @@ char *gpx_string(JsonNode *location_array)
|
||||
// <trkpt lat="xx.xxx" lon="yy.yyy"> <!-- Attribute des Trackpunkts --> </trkpt>
|
||||
|
||||
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, " <trkpt lat='%lf' lon='%lf' />\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, " <trkpt lat='%lf' lon='%lf'><ele>%.2f</ele><time>%s</time></trkpt>\n", lat, lon, alt, isotst);
|
||||
}
|
||||
|
||||
utstring_printf(xml, "%s", " </trkseg>\n</trk>\n</gpx>\n");
|
||||
|
Loading…
Reference in New Issue
Block a user