Google Earth is ignoring the point coordinates from my KML file

Go To StackoverFlow.com

0

So, I have some coordinates (324753.00N, 0692455.93E) in my KML file, but when I load said file, it defaults the latitude longitude under properties to either (180, 180), or (0, 0). All the other information from the file loads up just fine. I've tried swapping the order I pass them in and that didn't work. I changed the coordinates to 'simpler' numbers (32, 54) and they load up just fine.

I would just assume there was something wrong with the coordinates I have, but if I put them into the field to search by coordinates Google Earth finds the location with no problems.

I've tried a few different 'formats' but every time something different happens.

Any thoughts?

Between something someone below mentioned and the help of a coworker I figured out how to calculate the change. Dummy code belo as an example in case anyone else finds this.

double decimal = Convert.ToDouble(coordinates.Substring(0, coordinates.Length - 8));
double minutes = Convert.ToDouble(coordinates.Substring(coordinates.Length - 8, 2));
double seconds = Convert.ToDouble(coordinates.Substring(coordinates.Length - 6, 2));
double secDecimal = Convert.ToDouble(coordinates.Substring(coordinates.Length - 3, 2));

return Convert.ToString(decimal + (minutes/60) + (seconds/3600) + (secDecimal/360000))
2012-04-04 20:32
by A.J. Myers
Where is that location? Maps.google did not swallow it for me (which makes sense since the values should be between 0 and 90) The most obvious one would be that the values are multiplied by 100000 (1e5) which is rather common to be able to work with values as ints. In this case it leads me into the ocean near Nigeri - Eddy 2012-04-04 22:21


2

The KML spec requires point coordinates to be in longitude, latitude. See: https://developers.google.com/kml/documentation/kmlreference#point

You appear to be using projected coordinates. You may need to reproject your data into geographic coordinates (WGS84 datum). See the following for ideas on how to reproject your data: https://developers.google.com/kml/articles/vector

2012-04-05 03:00
by Tyler Erickson
Ads