VE seems to have incorrect latitude and longitude references

Hi,

Every single latllong that I go to on VE seems to be out by about 15km. I have used several different handheld GPS units to get latlong's of my local area and these match up exactly with google earth but are out by about 15km with VE. I have also downloaded WinformsEarthV2 and this seems to be having the same problem. Further to that I have taken an exact copy of sample code from the sdk and tried setting the center to one of my local latlongs and once again it was out by approximately 15km which gives me the impression that it's a VE problem not one with my code, but I don't think this is very likely. Therefore I must be doing something wrong!

Can anyone please point out what I am doing wrong?

Cheers,

Scott.

[764 byte] By [say_2000] at [2007-12-24]
# 1
How about posted a lat and lon that you have from your GPS and the location that VE plots it at with what VE gives the correct location in lat and lon? I have had no problems at all with accuracy. You doing anything strange like converting to decimal degrees?
John.
SoulSolutions at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 2
Thanks for that I knew it would be something stupid that I was doing. I was using the format (DDD?MM'SS.SSSS") and VE seems to use (DDD.DDDD). My question now is how do I convert from one to the other?
say_2000 at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 3
mmm i will add this to my blog of tips and tricks
John

private double degreesMinutesSecondsToDecimal(string degminsec)
{
//Divide the number of seconds by 60, 28.79 ÷ 60 = 0.5166.
//Add the result to the number of minutes, 31 + .47983.
//Divide the result by 60, 31.47983 ÷ 60 = 0.52466383.
//Now add that to the number degrees, 48 + .52466383.
//The result is 48.52466383°

double seconds = Double.Parse(degminsec.Substring(degminsec.Length - 4, 4));
double minutes = Double.Parse(degminsec.Substring(degminsec.Length - 6, 2));
double degrees = Double.Parse(degminsec.Substring(0, degminsec.Length - 6));

return (((seconds / 100 / 60) + minutes) / 60) + degrees;
}

SoulSolutions at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 4

Thanks again John, that's awesome!

Cheers,

Scott.

say_2000 at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 5
Not quite awesome enough....
If the value is negative then this is wrong so i quickly changed it to:

private double degreesMinutesSecondsToDecimal(string degminsec)
{
//Divide the number of seconds by 60, 28.79 ÷ 60 = 0.5166.
//Add the result to the number of minutes, 31 + .47983.
//Divide the result by 60, 31.47983 ÷ 60 = 0.52466383.
//Now add that to the number degrees, 48 + .52466383.
//The result is 48.52466383°

double seconds = Double.Parse(degminsec.Substring(degminsec.Length - 4, 4));
double minutes = Double.Parse(degminsec.Substring(degminsec.Length - 6, 2));
double degrees = Double.Parse(degminsec.Substring(0, degminsec.Length - 6));

if (degrees > 0)
{
return (((seconds / 100 / 60) + minutes) / 60) + degrees;
}
else
{
return degrees - (((seconds / 100 / 60) + minutes) / 60);
}
}

SoulSolutions at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 6
oh and the reason for the(seconds / 100 / 60) rather then /6000 is that the orginal logic in the comments has the milliseconds as a decimal after the seconds but my GPS devices just list it as 2879 so i added /100 to make it 28.79 in my notes so as to make it more obvious.
John.
SoulSolutions at 2007-10-7 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...

Windows Live Developer Forums

Site Classified