Search code examples
kmlgoogle-earth

KML crashes when open in GE but works fine on second time


Update: Per debracey's comment, this is the error message I get enter image description here

-

I made a simple KML using notepad++ that places 3 pushpins in different colors, and ads a small description to them.

When I open the KML for the first time, GE opens but crashes soon thereafter, displaying some sort of error message, but it closes as soon as it appears, so I can't tell what the error was. When I retry to open my KML, it works fine.

Here's the code:

<?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>Document.kml</name>
    <open>1</open>
    <Style id="blue">
        <LabelStyle>
            <color>ff007FFF</color>
        </LabelStyle>
        <Icon>
            <href>http://maps.google.com/mapfiles/kml/pushpin/blue-pushpin.png</href>
        </Icon>
    </Style>
    <Style id="green">
        <LabelStyle>
            <color>ff007FFF</color>
        </LabelStyle>
        <Icon>
            <href>http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png</href>
        </Icon>
    </Style>
    <Style id="red">
        <LabelStyle>
            <color>ff007FFF</color>
        </LabelStyle>
        <Icon>
            <href>http://maps.google.com/mapfiles/kml/pushpin/red-pushpin.png</href>
        </Icon>
    </Style>
        <Placemark>
            <name>point 1</name>
            <description>
                <![CDATA[
                    <a href="image.jpg" target="_blank">
                    <img src="image.jpg" border="0" 
                    width="320" height="230" title="title1"></a>
                    <br></br>
                    <a href="www.example.com">description</a>
                ]]>
            </description>
            <styleUrl>#blue</styleUrl>
            <Point>
                <coordinates>50.0000,50.0000,0</coordinates>
            </Point>
        </Placemark>
        <Placemark>
            <name>point 2</name>
            <description>
                <![CDATA[
                    <a href="image.jpg" target="_blank">
                    <img src="image.jpg" border="0"
                    width="320" height="240" title="title2"></a>
                    <br></br>
                    <a href="www.example.com">description</a>
                ]]>
            </description>  
            <styleUrl>#green</styleUrl>
            <Point>
                <coordinates>51.0000,51.0000,0</coordinates>
            </Point>
        </Placemark>
    </Document>
</kml>

I searched around and found this topic, but I don't think that's the same illness, just a similar symptom.

Appreciate your help.


Solution

  • As you suspected the error and crash was a symptom of a large saved places (myplaces.kml) file not the loading of a small KML file, which of itself was a valid KML file.

    When Google Earth crashed it may have restored the previous saved places file so you should make sure you have all the places you expect. That would explain why running it second time did not crash.

    Google Earth stores the saved places in a file named myplaces.kml along with the last saved place file named (myplaces.backup.kml).

    The location of your saved places file is OS-dependent and can be found here: http://support.google.com/earth/bin/answer.py?hl=en&answer=166438

    Since your saved place files is over 200K in the number of lines it's recommended to start cleaning house and archiving off those saved places you don't regularly access. Every time you load Google Earth it loads this saved places file and as well as every time you make a change so a large file will cause unnecessary delay. A smaller/leaner saved places file will be less likely to cause errors.

    You can find tips to manage your saved places file here: http://kml4earth.appspot.com/kmlBestPractice.html#Managing_Places