Permalink
Browse files

this will generate a kml from a log file

  • Loading branch information...
1 parent 1e09254 commit fb8e1341b0efe4a3b835616cce65fc782e2c80d9 @tz1 committed Jul 12, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 nmea2kml.c
View
@@ -0,0 +1,35 @@
+//gcc -I minigpsd -o nmea2kml nmea2kml.c minigpsd/gpsdata.c minigpsd/globals.c
+
+#include "minigpsd.h"
+int gpsgatefd = -1;
+int gpsgaterate = 1;
+int thisms = 0;
+int kmlinterval = 5;
+
+struct gpsstate gpst;
+struct gpssats gpsat;
+FILE *logfd = NULL;
+FILE *errfd = NULL;
+char *zipkml = "/usr/bin/kml2kmz";
+
+int main(int argc, char *argv[])
+{
+ char ibuf[4096];
+
+ logfd = NULL;
+ errfd = stderr;
+ zipkml = "echo";
+ kmlinterval=720;
+
+ while (!feof(stdin)) {
+ fgets(ibuf, 4095, stdin);
+ getgpsinfo(ibuf);
+ }
+ sprintf(ibuf, "%02d%02d%02d%02d%02d.kml", gpst.yr, gpst.mo, gpst.dy, gpst.hr, gpst.mn);
+ if (logfd) {
+ fclose(logfd);
+ rename("current.kml", ibuf);
+ }
+
+ return 0; // quiet compiler
+}

0 comments on commit fb8e134

Please sign in to comment.