diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-09-27 22:51:57 +1000 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-09-27 22:51:57 +1000 |
commit | 3b54329b359c374da1dba7ceaedd11f65e951d20 (patch) | |
tree | 11bc56b7f8f1716fa8755fc3407a0010905f0d26 /utilities/data2kml/data2kml.cpp | |
parent | 0befafaac02ccf2aca7ab0e6a6a6ac03f2ea5950 (diff) | |
download | 2021-arduino-obd-3b54329b359c374da1dba7ceaedd11f65e951d20.tar.gz 2021-arduino-obd-3b54329b359c374da1dba7ceaedd11f65e951d20.tar.bz2 2021-arduino-obd-3b54329b359c374da1dba7ceaedd11f65e951d20.zip |
Sync with latest data logging sketches
Diffstat (limited to 'utilities/data2kml/data2kml.cpp')
-rw-r--r-- | utilities/data2kml/data2kml.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utilities/data2kml/data2kml.cpp b/utilities/data2kml/data2kml.cpp index 0875503..cbcded5 100644 --- a/utilities/data2kml/data2kml.cpp +++ b/utilities/data2kml/data2kml.cpp @@ -11,6 +11,7 @@ #include <stdlib.h> #include <time.h> #include "logdata.h" +#include "kmlhead.h" typedef struct { uint32_t timestamp; @@ -114,7 +115,7 @@ void WriteKMLData(KML_DATA* kd, uint32_t timestamp, uint16_t pid, float value[]) fprintf(kd->fp, "T%02u:%02u:%02u.%03uZ", kd->curTime / 10000000, (kd->curTime / 100000) % 100, (kd->curTime / 1000) % 100, kd->curTime % 1000); } fprintf(kd->fp, "</when>"); - fprintf(kd->fp, "<gx:coord>%f %f %f</gx:coord>", kd->datas.lon, kd->datas.lat, kd->datas.alt); + fprintf(kd->fp, "<gx:coord>%f %f %d</gx:coord>", kd->datas.lon, kd->datas.lat, kd->datas.alt); kd->datas.timestamp = timestamp; kd->dataset = (DATASET*)realloc(kd->dataset, sizeof(DATASET) * (kd->datacount + 1)); @@ -284,6 +285,7 @@ int ConvertToKML(const char* logfile, const char* kmlfile, uint32_t startpos, ui KML_DATA* kd = (KML_DATA*)calloc(1, sizeof(KML_DATA)); kd->fp = fopen(kmlfile, "w"); + //fprintf(kd->fp, "%s", kmlhead); AppendFile(kd->fp, "kmlhead.txt"); int elapsed; @@ -328,6 +330,7 @@ int ConvertToKML(const char* logfile, const char* kmlfile, uint32_t startpos, ui WriteKMLTail(kd); Cleanup(kd); + fclose(fp); return 0; } |