[PATCH] Add GPS locations to some of the test dives
Dirk Hohndel
dirk at hohndel.org
Sun Jan 13 10:25:47 PST 2013
Henrik Brautaset Aronsen <subsurface at henrik.synth.no> writes:
> Henrik Brautaset Aronsen wrote:
>> subsurface at henrik.synth.no wrote:
>>> From: Henrik Brautaset Aronsen<subsurface at henrik.synth.no>
>>>
>>> With Pierre-Yves' commit with a map widget, here are a couple of example
>>> GPS locations from my own dives.
>>
>> This also shows a slight problem with the map, as the positions seems
>> to be slightly wrong. E.g. dive10.xml is at "63.01043, 7.31243",
>> which is here: http://goo.gl/maps/AwWf1. The Subsurface map puts the
>> position about 22km further south/west.
>
> I found the problem. We lost precision by dividing a double by an int.
> Fix:
>
> diff --git a/gps.c b/gps.c
> index e70c719..768f2d6 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 / 1000000,
> - dp->longitude.udeg / 1000000);
> + add_gps_point(map, dp->latitude.udeg / 1000000.0,
> + dp->longitude.udeg / 1000000.0);
> }
> }
> osm_gps_map_set_center_and_zoom(map, 0, 0, 0);
>
Yep - that's the same thing I just fixed as well. Pierre seems to have
added your SOB, but not your patch :-)
/D
More information about the subsurface
mailing list