views:

1239

answers:

1

I am having a problem with Google Earth freezing up both when I try to open it and when I try to plot KML files into it.


Opening Google Earth:

Sometimes when I try to open Google Earth it just freezes while:

Loading myplaces.kml, including enabled overlays

I am assuming this problem is being caused by the fact that if I add up the total size of the kmls that I have saved to "my places" they are somewhere in the neighborhood of 3MB. When I search my comp for "my places" the size of that file is only just under 400kb. I am assuming this means Google Earth is storing it in a different format.
At any rate, what should I do? I would really prefer to keep everything in Google Earth's "my places" since each file takes forever to load, but if I need to delete "my places" and start over I guess I'll have to do that. Also, I can't just close Google Earth and open it back up when it becomes non-resposive because it still doesn't work. Sometimes if I let it sit a while without touching it after it closes then it will open OK. Any idea what is going on?


Plotting kmls in Google Earth:

The kml files I am trying to load into Google Earth range from around 67kb for a file containing 177 points, to 454kb with 1172 points. I also had a kml file I had to plot that is 937kb containing 2637 points. Most of the time to get the files to plot, I have to edit the kml with notepad, delete all but one of the points, plot that point, and then rerun an Excel macro to get the full file back. I then plot it, which causes this message:

Are you sure you want to reload this file, any unsaved edits will be lost?

It then starts plotting just fine at that point usually. If I try to just double click on the kml file without having done the process I just talked about, Google Earth becomes non-responsive. Here is a sample of my code and a sample of part of the kml file it creates.
Any idea about what I can do to solve these problems?
Would using a "template" to fill in the data for the kml work better?


Notes:

  • I am running Windows XP on my computer. My boss is running Vista Business and he normally has this problem more than I do.

  • I am aware that the code is kind of ugly and needs to be cleaned up but my boss has told me not to bother since what I am doing won't be used in production and to focus more on getting the files he needs than making the code more readable. Please go easy on the ugliness.

  • This is code I was handed to modify to get the data we need and therefore I don't know anything about how efficient it is compared to other methods.


Code:

Sub Create_KML()
REM Builds KML from spread sheet

REM Open File For Random As #1 ' "c:\Users\mwilson\Desktop\Trash.txt
REM Open "c:\Users\mwilson\Desktop\Test Google\Trash.txt" For Output As #1
Open "C:\Documents and Settings\eecoop\Desktop\10 day avg rssi Google kml\MorrisAveOpelikaMIUS.kml" For Output As #1
i = 2
miuID = Range("A" & i).Text
RSSI = Range("C" & i).Text
ColID = Range("G" & i).Text
ColName = Range("F" & i).Text
Address = Range("M" & i).Text & ", Opelika, AL"
Print #1, "<?xml version=""1.0"" encoding=""utf-8""?>"         
Print #1, "<kml xmlns=""http://www.opengis.net/kml/2.2""&gt;"     
Print #1, "<Document>"
While miuID <> ""
If RSSI >= -85 Then
DotColor = "Green.png"
ElseIf RSSI >= -95 Then
DotColor = "Yellow.png"
ElseIf RSSI >= -105 Then
DotColor = "Orange.png"
Else
DotColor = "Red.png"
End If

Print #1, "   <Placemark>"                                        '3
Print #1, "     <name>"; RSSI; " / "; ColID; "</name>"                        '4
Print #1, "     <description>"; miuID; " Owned by "; ColName; "</description>"                        '4
Print #1, "        <Style>"                                     '5
Print #1, "           <IconStyle>"                              '6
Print #1, "               <scale>.6</scale>"                    '7
Print #1, "               <Icon>"                               '8
Print #1, "                  <href>"; DotColor; "</href>"           '9
Print #1, "               </Icon>"                             '10
Print #1, "            </IconStyle>"                            '11
Print #1, "        </Style>"                                     '12
Print #1, "     <address>"; Address; "</address>" '13
Print #1, " </Placemark>"                                        '14

i = i + 1
miuID = Range("A" & i).Text
RSSI = Range("C" & i).Text
ColID = Range("G" & i).Text
ColName = Range("F" & i).Text
Address = Range("M" & i).Text & ", Opelika, AL"
Wend
Print #1, "</Document>"
Print #1, "</kml>"                                               '15
Print #1, " "
    Close #1

End Sub


KML:

<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"&gt;
<Document>
   <Placemark>
     <name>-108 / 4</name>
     <description>110001124 Owned by Morris Ave.</description>
        <Style>
           <IconStyle>
               <scale>.6</scale>
               <Icon>
                  <href>Red.png</href>
               </Icon>
            </IconStyle>
        </Style>
     <address>3501 BIRMINGHAM HWY, Opelika, AL</address>
 </Placemark>
   <Placemark>
     <name>-95 / 4</name>
     <description>110001146 Owned by Morris Ave.</description>
        <Style>
           <IconStyle>
               <scale>.6</scale>
               <Icon>
                  <href>Yellow.png</href>
               </Icon>
            </IconStyle>
        </Style>
     <address>2100 INDUSTRIAL BLVD, Opelika, AL</address>
 </Placemark>
A: 

3MB uncompressed KML sounds pretty small. Google Earth generally doesn't have problems dealing with files of that size. What version of GE are you using?

If the KML doesn't have any proprietary information in it, mind posting a link to one of them?

Roman Nurik
Google Earth5.0.11733.9347Build DateMay 5, 2009Build Time2:43:21 amRendererOpenGLOperating SystemMicrosoft Windows XP (Service Pack 3)Video DriverIntel (00006.00014.00010.04837)Max Texture Size2048x2048Serverkh.google.comThis is all of the information i can find on my google earth. And i just had a DOH! moment, my problem also might be a sucky old graphics card in my comp here at work.
Bryan
Roman Nurik