2

I have a KML file created from an Excel spreadsheet which contains name, lat and long. How can I display the name in Google Earth?

2 Answers 2

1

I'm not sure what app. you used to create the kml from the excel file but in simplistic terms you will need to embed a name tag within a Placemark tag to show label for each point, see example xml below (label in this example is "Untitled Placemark"):

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>test.kml</name>
    <StyleMap id="m_ylw-pushpin">
        <Pair>
            <key>normal</key>
            <styleUrl>#s_ylw-pushpin</styleUrl>
        </Pair>
        <Pair>
            <key>highlight</key>
            <styleUrl>#s_ylw-pushpin_hl</styleUrl>
        </Pair>
    </StyleMap>
    <Style id="s_ylw-pushpin">
        <IconStyle>
            <scale>1.1</scale>
            <Icon>
                <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
            </Icon>
            <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
        </IconStyle>
    </Style>
    <Style id="s_ylw-pushpin_hl">
        <IconStyle>
            <scale>1.3</scale>
            <Icon>
                <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
            </Icon>
            <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
        </IconStyle>
    </Style>
    <Placemark>
        <name>Untitled Placemark</name>
        <LookAt>
            <longitude>-122.2109720652407</longitude>
            <latitude>41.31147768821823</latitude>
            <altitude>0</altitude>
            <heading>-9.207431002912404e-008</heading>
            <tilt>44.99911020701676</tilt>
            <range>176757.1969144266</range>
            <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
        </LookAt>
        <styleUrl>#m_ylw-pushpin</styleUrl>
        <Point>
            <gx:drawOrder>1</gx:drawOrder>
            <coordinates>-122.3283130204979,41.24737300737706,0</coordinates>
        </Point>
    </Placemark>
</Document>
</kml>

You may open up the kml in a text editor to add or edit tags.

0

This question was asked long long ago, but I just had the same problem. The solution for me was to change the name of the columns to names that GE understands. If I understood correctly you can choose one column to be the title and another column to be the description. So I named one column Name (this will be displayed as the title) and the other column I named description. This is how GE understands that these should be the labels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.