Google Earth Cacher

July 13, 2008 at 9:20 pm Leave a comment

I’m going to France tomorrow, and I’m taking my laptop with me. That’s why I want a certain area on the map of France to be cached in Google Earth, so I can take a look at it while I”m there (without an internet connection). I made an autoIt script that takes the coordinates of a place (ie your hotel) and some other parameters to define a grid around this place. This grid of locations gets generated by the script and saved in a *.kml file. You can open this kml file in Google Earth, and play it as a tour. Google Earth goes to all the locations and caches the data of them. When you revisit these locations without an internet connection, Google Earth loads the data from its cache file. If you want, you can take a copy of the cache and burn it on a dvd. You can replace your Google Earth cache with this cache when you need it. The cache file is located at E:\Documents and Settings\yourname\Local Settings\Application Data\Google\GoogleEarth\dbCache.dat, but I take a copy of the whole folder, just to be sure :-).
For the best results, set your cache size to the maximum in Google Earth Options. You can also clear your cache before you start.
NOTE! Always make sure to include a global overview in the cache (=the view of the globe when you start Google Earth), otherwise Google Earth will not start without an internet connection (so always check once before you step on your plane to Timboektoe :p)

The script asks for a few parameters when you run it:

centrum latitude The latitude of the centre of the grid (ie your hotel”s latitude)
centrum longitude The longitude of the centre of the grid (ie your hotel”s longitude)
An easy way to find these two values is to add a placemark at the desired centre in Google Earth, and save this placemark as a kml file. Open the file with notepad and just read out the longitude and latitude!
delta The (horizontal or vertical) space between the adjacent grid points.
x latitude count latitude = centrum-x*delta..centrum+x*delta So the number of grid points in the direction of latitude is 2*x+1
x longitude count longitude = centrum-x*delta..centrum+x*delta So the number of grid points in the direction of longitude is 2*x+1

The script then generates a file named cacheThis.kml, when you take a look at it in notepad you get a file like this:


<?xml version=”1.0″ encoding=”UTF-8″?> 
<kml xmlns=”http://earth.google.com/kml/2.1″> 
<Document> 
<name>cacheThis.kml</name> 
<Style id=”sh_ylw-pushpin”> 
<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> 
<Folder> 
<name>frankrijk 2007 terrein</name> 
<open>1</open> 

<Placemark> 
<name>t-10-10</name> 
<LookAt> 
<longitude>4.560245</longitude> 
<latitude>44.615664</latitude> 
<altitude>0</altitude> 
<range>1000.00</range> 
<tilt>-3.00e-010</tilt> 
<heading>0.007707753019361555</heading> 
</LookAt> 
<styleUrl>sh_ylw-pushpin</styleUrl> 
<Point> 
<coordinates>4.560245,44.615664,0</coordinates> 
</Point> 
</Placemark> 

<Placemark> 
<name>t-10-9</name> 
<LookAt> 
… 
</Placemark> 
</Folder> 
</Document> 
</kml> 

The first few lines are not really important. The lines between the <Placemark> and </Placemark> tags describe one grid point. Jup, it’s that easy :p
Next you fire up your Google Earth and open the kml file. You will probably see a lot of yellow pins in a grid, meaning that everything went well thus far. Now click play and make sure that Google Earth can load all the data in time (before going to the next point). If not, change the tour speed in options.
After a while your cache file is ready to go on a trip with you!

Advertisements

Entry filed under: Uncategorized.

Scope with PIC microcontroller and Matlab Using Eclipse for multi-module Maven2 projects

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Feeds

Articles to be written…

Twitter – kr3l

my del.icio.us

RSS Google Reader Shared Stuff

  • An error has occurred; the feed is probably down. Try again later.

RSS Listening to..

  • An error has occurred; the feed is probably down. Try again later.

%d bloggers like this: