Latitude and Longitude the wrong way round.

5,884 views
Skip to first unread message

Gordon Campbell

unread,
Jan 22, 2011, 7:53:33 AM1/22/11
to KML Developer Support - Advanced Support for KML
I am currently making a kml sitemap for a website using the standard
format of Latitude, longitude. I opened this file in Google Earth and
it took me to the middle of the ocean. Doing this I assumed I had
made a mistake with the co-ordinates, so I double checked it in Google
Maps and my co-ordinates were correct.

Upon further investigation I found that when Google earth saves kml
files it stores the co-ordinates as longitude, latitude. Can someone
shed any light as to why? Also, what is the correct format when
creating a KML file for a website, should I store the co-ordinates as
longitude, latitude, the way Google maps measures it. Or store it as
longitude, latitude the way Google Earth and Google my maps measure
it?

Gordon.

barryhunter (KML Guru)

unread,
Jan 22, 2011, 12:04:11 PM1/22/11
to KML Developer Support - Advanced Support for KML
There is no absolute correct way, its just convention. Humans tend to
do it lat then long, but just for conveince.

Traditionally, computers use x, y coordinates. Under that convention,
long is x, latitude is y, which means long then lat. Thats what the
KML developers probably did.

KML files, should always use longitude, latitude, and optional
altitude. (in that order)
http://code.google.com/apis/kml/documentation/kmlreference.html#coordinates
Because the altitude is optional, it can simply be left off totally,
with or without the comma. Personally think is clearer without the
comma, but it doesnt matter if its there.

StarTraX

unread,
Jan 22, 2011, 4:09:56 PM1/22/11
to KML Developer Support - Advanced Support for KML
And then it gets really tricky in the GEPlugin where they decide to do
it the other way:
set (double latitude, double longitude, double altitude....)
hehe!

On Jan 23, 4:04 am, barryhunter (KML Guru) wrote:
> There is no absolute correct way, its just convention. Humans tend to
> do it lat then long, but just for conveince.
>
> Traditionally, computers use x, y coordinates. Under that convention,
> long is x, latitude is y, which means long then lat. Thats what the
> KML developers probably did.
>
> KML files, should always use longitude, latitude, and optional
> altitude. (in that order)http://code.google.com/apis/kml/documentation/kmlreference.html#coord...

juanchosierrar

unread,
Jan 23, 2011, 6:21:38 AM1/23/11
to KML Developer Support - Advanced Support for KML
Hello Gordon

if you get in the ocean is because they are badly designed need to be
aware that Google Earth works with Lat and Lon, and wgs84, if you want
to change this kind of visualization you can go to options and at the
bottom left to change the type of screening. height I have done some
work, but when generating the kml z option can generate from the same
kml file in the properties option.

Greetings


On 22 ene, 22:09, StarTraX wrote:
> Y entonces se pone muy complicado en el GEPlugin su decisión de hacerla otra manera:conjunto (latitud doble, de longitud doble, doble altura ....)jeje!
>
> El 23 de enero, 04:04 am, barryhunter (KML Guru) escribió:
>
>
>
>
>
>
>
> > No hay manera absoluta correcta, su convención justa.Los seres humanos tienden a> Lo lat continuación, largo, pero sólo para conveince.
>
> > Tradicionalmente, los equipos utilizan coordenadas x, y.En virtud de dicho convenio,> Largo es x, la latitud es y, lo que significa largo, lat.Eso es lo que el> Desarrolladores de KML probablemente lo hizo.
>
> > Archivos KML, siempre debe utilizar la longitud, latitud, y opcionalaltitud>.(En ese orden)http://code.google.com/apis/kml/documentation/kmlreference.html # coord...> Debido a la altitud es opcional, sino que simplemente se puede dejar fuera totalmente,> Con o sin la coma.Personalmente creo que es más claro sin lacoma>, pero no importa si está allí.
>
> > El 22 de enero, 24:53, Gordon Campbell escribió:
>
> >> Actualmente estoy haciendo un mapa del kml para un sitio web utilizando el estándar>> Formato de latitud y longitud.Abrí este archivo en Google Earth y>> Que me llevó a la mitad del océano.Hacer esto asumí que había>> Cometido un error con las coordenadas, así que doble que la revise en Google>> Mapas y mis coordenadas eran correctas.
>
> >> Tras realizar investigaciones adicionales que encontré que cuando Google Earth guarda kml>> Archivos que almacena las coordenadas de longitud, latitud.¿Puede alguien>> Arrojar alguna luz sobre por qué?Además, ¿cuál es el formato correcto cuando>> Crear un archivo KML para un sitio web, debo guardar las coordenadas como> Longitud>, la latitud, los mapas de Google forma en que las medidas.O guardarlo como>> Longitud, latitud de la manera de Google Earth y Google mi medida mapas> Que>?
>
> >> Gordon.

Gordon Campbell

unread,
Jan 23, 2011, 9:58:43 AM1/23/11
to KML Developer Support - Advanced Support for KML
Thanks guys for all your help. Juan, I know it was designed wrong,
but every instruction for building kml files, that are linked from
your site map, online has said put it in the order of lat and long.

Just to clarify. With regards to my kml file, linked from my
sitemap. I should use long, lat?

Thanks for all your help guys.

Rossko

unread,
Jan 24, 2011, 4:45:45 AM1/24/11
to KML Developer Support - Advanced Support for KML
> Just to clarify.  With regards to my kml file, linked from my
> sitemap.  I should use long, lat?

Yes.
Here is the KML guide again -
http://code.google.com/apis/kml/documentation/kmlreference.html#coordinates

Kriston

unread,
Jan 31, 2011, 6:30:14 PM1/31/11
to kml-suppor...@googlegroups.com
Speaking of the order of lat and lon, when I first encountered XML I was incensed that the order of elements should matter.  Then I had to write a parser.

DrJ

unread,
Mar 10, 2011, 9:47:04 PM3/10/11
to kml-suppor...@googlegroups.com
@Barry...
 
I understand and agree that there is NO lat/lon police who set the order; however, even you acknowledge that there is almost a world wide agreement on how to do it and it isn't the way Keyhole does it!  And, we can accept that Google didn't invent it, only bought the company - and that now the deed is done the fix would be a hundred-fold more painful than just enduring the problem. And, why should the elephant worry about all the little ants on the ground?
 
I wonder, however, if you could answer another question then: WHY aren't Google programmers even internally consistent with themselves?  The single greatest waste of my time, in producing hundreds of maps, is that GE provides absolutely NO assistance in "copy and pasteing" coordinates from the Google Earth "properties" popup - into GEs EXPECTED kml format.  If one is trying to copy and paste coordinates into a KML file which you are editing, you first select the placemark, then click on "properties" and then cut and paste the values for lat and long (remembering to cross over). HOWEVER, Google earth programmers don't even list them in that order in their property pop up!  THEN, once you get that into your brain - you cannot even do a simple select, copy, paste!   Some lame-brain took it upon themselves, a few versions back, to add eye-candy formatting to the text box so simple copy and past doesn't work!  Now there's a space included in one of the fields and not the other, and the absurd degree characters.  IF that's the way Google Earth programmers want to display it then why don't they allow the extraneous characters in the KML set up?
 
What We Have Needed For Several Versions: All the time wasted on our part could be dramatically improved by a simple "copy coordinates" button which would load the clipboard with a text string of "lon,lat,alt" in that order and be comma delimted.  That way we could avoid all the meticulous mouse selecting between individual characters and in one fell swoop paste it into KML code without needing to rearrange values which shouldn't have been coded that way in the first place.
 
At very least, the programmer who took it upon himself (or supervisor who wrote the spec) needs thump up the side of the head and to remove all the idiot extraneous characters from the selectable text field - if they think we have to be told that the number is "degrees" then put it in a graphic or some sort - and take out that stupid space!
 
Sorry, for the bold and few caps; but, as you can tell - this issue stirs my soul! I've waited for over a year now thinking that at some time one of the GE programmers would actually try to do some production kml map making and see for themselves how user un-friendly they've made the interface. Alas, we're all still waiting their enlightenment.

StarTraX

unread,
Mar 10, 2011, 10:11:47 PM3/10/11
to KML Developer Support - Advanced Support for KML
Boy! You really know how to sweet talk a gal!
> *What We Have Needed For Several Versions: *All the time wasted on our part
> could be dramatically improved by a simple *"copy coordinates" button* which

Mallee

unread,
Mar 13, 2011, 11:52:18 PM3/13/11
to KML Developer Support - Advanced Support for KML
Little tip for you, DrJ, which I just read in the KML reference
(http://code.google.com/apis/kml/documentation/kmlreference.html):

"Tip: Viewing KML for Google Earth Features
Here is a handy feature of Google Earth that makes it easy to view the
KML file for any Feature. In Google Earth, you can right-click a
Feature in the Places panel and copy it. To view the corresponding KML
for the copied object, open your favorite text editor and paste the
selection into it."

Looks like the GE programmers may have been a few steps ahead of
you...


On Mar 11, 1:47 pm, DrJ wrote:
> *What We Have Needed For Several Versions: *All the time wasted on our part
> could be dramatically improved by a simple *"copy coordinates" button* which

cintos

unread,
Mar 15, 2011, 12:52:53 PM3/15/11
to KML Developer Support - Advanced Support for KML
DrJ:

Nitpicking, I say. But here in the USofA, the USGS is the mapping
authority. I just noticed the string in my application's http request
to the USGS for elevation data:

"http://gisdata.usgs.net/xmlwebservices2/elevation_service.asmx/
getElevation"
"requestGetParameters ="X_Value=" + lonD + "&Y_Value=" + latD +"

- Michael
> *What We Have Needed For Several Versions: *All the time wasted on our part
> could be dramatically improved by a simple *"copy coordinates" button* which

mikemcc

unread,
Mar 16, 2011, 4:22:58 AM3/16/11
to KML Developer Support - Advanced Support for KML
You/we might not like the tone of some posts, and DrJ apologized in
advance, but I do think he has some points. Also it can be dodgy to
accuse people of nitpicking because good design of anything (software,
services, businesses, sports teams) involves getting dozens of little
things right. Some 'hurdles' seem trivial to people who happen to only
perform a task once in a long while, but they aren't trivial at all to
people who use a badly-designed feature many times a day.

I don't have time to work through the things DrJ mentions and confirm
whether they are the 'micro-features' which I find are badly designed,
but I imagine they are. I have even had to develop little tools to
help get around such features.

We all know that GE is a fantastic tool and some of the support is
superb, but *all* software should be used intensively and reviewed
often by company employees who aren't closely involved as developers,
to see whether improvements should be made. Failing that, surely the
company and/or the user community should react positively to outsiders
who are using the software intensively, who find poor micro-features
and who take the time to point them out - even if the frustration
sometimes shines through ?

Jason M

unread,
Mar 16, 2011, 12:33:25 PM3/16/11
to KML Developer Support - Advanced Support for KML
I've submitted a feature request for what DrJ described above. Great
idea. That would not only eliminate tedious mouse copying but mis-
ordering the lat/lon coordinate errors.

http://code.google.com/p/kml-samples/issues/detail?id=378

There's a related feature request in Google Earth's bin as far back as
2008 but not enough people have "starred" it.

This suggested adding a right-mouse option from map to copy
coordinates to clipboard.
http://code.google.com/p/kml-samples/issues/detail?id=3

--jason

cintos

unread,
Mar 16, 2011, 11:47:20 PM3/16/11
to KML Developer Support - Advanced Support for KML
Greetings:

Yes, a right click to copy coordinates would be helpful for casual
data capture. However, I might be missing something because of my
personal needs and user experience. My code takes folders of tens or
hundreds of placemarks or overlays and process them. This is a simple
"copy" of the folder out of Google Earth's DOM where it was created.
It is simple to parse the KML text strings to find the lon,lat,alt
string (I also snag the rotation of overlays). I approached the entire
kit of linestring, point, groundoverlay, etc as net new, and don't see
where it fits into any proscribed framework for structure. Perhaps if
I had an extensive background in ERSI or other kit, I'd be look for
familiarity.

BTW, Google Maps now has a "Drop Lat/Lng Marker" that displays a small
balloon with text that can be copied.

- Michael
Reply all
Reply to author
Forward
0 new messages