The_Wind_777
unread,May 4, 2006, 11:41:17 AM5/4/06Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to KML Discussions
This is probably a stupid question, and probably has to do with 3D Math, but... here goes.
I am currently using AccessBasic to read in, grab placemark names, then write out the Latitude and Longitude of each placemark.
However, I found that when you just grab the Latitude and Longitude out of the file, they aren't correct.
If you put those latitude / longitude coordinates back into GoogleEarth, then you don't get the exact same spot on the globe?
And, if I do an extremely close rollover on a placemark, the Pointer Lat and Lon don't match up.
I'm wishing to use decimal mode.
Let's give an example...
I put a placemark in the very center of Sedan Crater at the Nevada Test Site
I zoom in the interface until I can't zoom in any more, roll over so I'm exactly centered on the placemark crosshairs and the rollover coordinates say:
Pointer Lat 37.176961 Lon -116.046097 elev 4032 ft.
I write out a KML file and inside, it says this:
<Placemark>
<name>(Nothing to do with bike trip) Nevada Test Site - Sedan Explosion</name>
<LookAt id="khLookAt737">
<longitude>-116.0469812505719</longitude>
<latitude>37.17686224286457</latitude>
<range>1014.685426290953</range>
<tilt>-1.129373905529457e-011</tilt>
<heading>-0.1400624146646101</heading>
</LookAt>
<styleUrl>root://styleMaps#default+nicon=0x307+hicon=0x317</styleUrl>
<Style id="khStyle738">
<IconStyle id="khIconStyle739">
<Icon>
<href>root://icons/palette-3.png</href>
<x>96</x>
<y>96</y>
<w>32</w>
<h>32</h>
</Icon>
</IconStyle>
</Style>
<Point id="khPoint745">
<coordinates>-116.0460964057671,37.17696087000618,0</coordinates>
</Point>
</Placemark>
If I then grab the latitude and longitude from that:
37.17686224286457, -116.0469812505719
Immediately, you can see that the two don't match.
The rollover said:
37.176961, -116.046097
and, if you round that off, you get:
37.176862, -116.046981
So, particularly with the Longitude, it's quite badly off.
If you put the coordinates from the KML file back into Google Earth and push ENTER, you will get a placemark that's shifted to the left of where it should be by about a seventh the width of Sedan Crater.
...
However, if you look at the values between <coordinates> and </coordinates>, those seem to be the right values.
So, how does one convert the <latitude> <longitude> values so they equal the <coordinate> values?
And sometimes it's even much worse than that. Sometimes it will shift many inches between the reading it gives you by rolling over the interface, and the coordinates you take from the KML file.
Somehow, I want to be able to have an equation that I use to put the KML Latitude / Longitude values through so I can use them to put back into Google Earth arrive exactly at the proper placemark position, where it should be.
Is there some sort of mathematical computation that's going on, having to do with the range, tilt and heading values not being exactly perfect to make the two match up properly?