From fdd951a0a154acb7f6cf754a7e11567319507317 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Fri, 1 Apr 2005 19:05:56 +0000 Subject: Make geoid separation availble to the Garmin. --- garmin.c | 4 ++++ geoid.c | 4 +++- gpsutils.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/garmin.c b/garmin.c index 0124fe20..35bfd482 100644 --- a/garmin.c +++ b/garmin.c @@ -334,6 +334,10 @@ static int PrintPacket(struct gps_device_t *session, Packet_t *pkt) , session->gpsdata.status); gpsd_report(3, "UTC Time: %lf\n", session->gpsdata.fix.time); + gpsd_report(3, "Geoid: from garmin %lf, calculated %lf\n" + , pvt->msl_hght + , wgs84_separation(session->gpsdata.fix.latitude + , session->gpsdata.fix.longitude)); gpsd_report(3, "Alt: %.3f, Epe: %.3f, Eph: %.3f, Epv: %.3f, Fix: %d, Gps_tow: %f, Lat: %.3f, Lon: %.3f, LonVel: %.3f, LatVel: %.3f, AltVel: %.3f, MslHgt: %.3f, Leap: %d, GarminDays: %ld\n" , pvt->alt , pvt->epe diff --git a/geoid.c b/geoid.c index 74599dd4..55d6901b 100644 --- a/geoid.c +++ b/geoid.c @@ -21,7 +21,9 @@ static double bilinear(double x1, double y1, double x2, double y2, double x, dou return (z22*(y-y1)*(x-x1)+z12*(y2-y)*(x-x1)+z21*(y-y1)*(x2-x)+z11*(y2-y)*(x2-x))/delta; } -static double wgs84_separation(double lat, double lon) + +/* return wgs84 to MSL geoid separtion in meters, given a lat/lot */ +double wgs84_separation(double lat, double lon) { #define GEOID_ROW 19 #define GEOID_COL 37 diff --git a/gpsutils.h b/gpsutils.h index f6ef23c0..b396d115 100644 --- a/gpsutils.h +++ b/gpsutils.h @@ -6,3 +6,6 @@ extern double iso8601_to_unix(char *); extern char *unix_to_iso8601(double t, char *); extern double gpstime_to_unix(int, double, int); extern double earth_distance(double, double, double, double); + +/* return wgs84 to MSL geoid separtion in meters, given a lat/lot */ +extern double wgs84_separation(double lat, double lon); -- cgit v1.2.1