[PATCH] Work on a dive localisation tool using GPS coordinates

Henrik Brautaset Aronsen henrik.aronsen at gmail.com
Sun Jan 13 05:02:09 PST 2013


Pierre-Yves Chibon wrote:
> For each dive recorded, place their GPS coordinates onto a map using the
> OSM-GPS-MAP library.
>
> This map is accessible via the "log" menu or the shortcut ctrl+M (M as map).
>
> We check for the GPS coordinates "0, 0" which are the default when we do not
> have real GPS coordinates set.

If I add <gps>59.903897 10.742526</gps> to a dive.xml, the locations 
read by gps.c are off by a factor of ten.

Fix:

diff --git a/gps.c b/gps.c
index 80a8aa0..e70c719 100644
--- a/gps.c
+++ b/gps.c
@@ -64,8 +64,8 @@ void show_gps_locations()
                 dp = dive_table.dives[idx];
                 //printf("%s - %u,%u\n", dp->location, 
dp->latitude.udeg, dp->longitude.udeg);
                 if (dp->latitude.udeg != 0 && dp->longitude.udeg != 0){
-                       add_gps_point(map, dp->latitude.udeg / 100000,
-                               dp->longitude.udeg / 100000);
+                       add_gps_point(map, dp->latitude.udeg / 1000000,
+                               dp->longitude.udeg / 1000000);
                 }
         }
         osm_gps_map_set_center_and_zoom(map, 0, 0, 0);

Henrik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130113/30c435e4/attachment-0001.html>


More information about the subsurface mailing list