Two points with same coordinates - only one shows up on map.

616 views
Skip to first unread message

m.

unread,
Jan 31, 2012, 8:21:31 PM1/31/12
to KML Developer Support - Getting Started with KML
In a KML file being viewed in Google Maps, I have two placemark points
that share the same coordinates - same latitude, same longitude. I've
found that this leads to the 2nd point being treated as if it does not
exist -- it does not show up on the map or the left-side list.
However, they signify different things, and I need for BOTH of them to
show up. I've tried adding IDs to the points, but that has not helped.
Even if they have different names and descriptions, it doesn't help.

I made an example file to illustrate the problem. The KML looks like
this:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Folder>
<Placemark>
<Point ID="1"><coordinates>-125.4293255, 40.6295950</coordinates></
Point>
</Placemark>
<Placemark>
<Point ID="2"><coordinates>-125.4293255, 40.6295950</coordinates></
Point>
</Placemark>
<Placemark>
<Point ID="3"><coordinates>-125.4509351, 40.6477021</coordinates></
Point>
</Placemark>
</Folder>
</Document>
</kml>

You can see it in Google Maps here:
http://g.co/maps/35uk6

You'll see that though 3 point placemarks are defined, only 2 actually
show up.

Does anyone know of a way to fix this, short of slightly changing the
latitude/longitude of one? The latitude/longitude data is
automatically generated from another program, so I cannot easily
change it (nor do I wish to sacrifice accuracy).

Thanks in advance.

shannon9585

unread,
Feb 1, 2012, 11:54:47 AM2/1/12
to KML Developer Support - Getting Started with KML
Two things: I ran the KML code through an online KML Validator
(http://www.kmlvalidator.com/) and you have 2 errors.

The first is that you should replace <kml xmlns="http://
earth.google.com/kml/2.2"> with <kml xmlns="http://www.opengis.net/
kml/2.2"> .

I think the bigger problem is with your coordinates. KML coordinates
must contain longitude, latitude, and altitude (in that order). Refer
to http://code.google.com/apis/kml/documentation/kmlreference.html#coordinates

So your code for your first placemark should be:

<Placemark>
<Point ID="1"><coordinates>-125.4293255,
40.6295950, 0</coordinates></Point>
</Placemark>

Perhaps the missing altitude coordinate is throwing off Google Maps.
I'd try that and see if that fixes your problem. It will at least
help narrow it down.

barryhunter (KML Guru)

unread,
Feb 1, 2012, 12:09:37 PM2/1/12
to KML Developer Support - Getting Started with KML
Try giving your <Placemarks> id's. Not the <Point>.

Also note kml is case sensensive, should be [ id= ]

You could also try adding a <name> to the placemark. Thats more likly
to act as a 'key'.



Also remove spaces from coordaintes. There should be no spaces between
elements of the same point. Maps doens't notice. Google earth will

m.

unread,
Feb 1, 2012, 4:57:08 PM2/1/12
to KML Developer Support - Getting Started with KML
That was very helpful. Thank you. I tried making the "id" lowercase in
<point id="1">, but that didn't help. Then I took your other
suggestion, of using <placemark id="1">, and that worked like a charm.
Now all the points show up in the list.
Reply all
Reply to author
Forward
0 new messages