View Single Post
Old 09-12-2006, 03:48 PM   #24
clarkie
Low Bitrate
 
Join Date: Jul 2005
Posts: 74
The reason for this error is a rounding error in the routine ConvertDegreeMinuteSecondToDegrees in the origional int32 was used.

I am assuming that the same code was used.

In my case when in Southampton UK the GPS had me located in the middle of english channel. At home 8 miles away all was ok.

/// <summary>
/// Expects input in dddmm.mmmm or ddmm.mmmm format
/// </summary>
/// <param name="input"></param>
/// <returns></returns> private double
ConvertDegreeMinuteSecondToDegrees(string input)
{

if(input == null || input.Length <=0)
return 0;
double inputvalue = Convert.ToDouble(input);

int degrees = (int)(inputvalue/100);

return degrees + (inputvalue - (degrees * 100))/60;

}
clarkie is offline   Reply With Quote