blankblank blank


Archive Page 44 of 106



Using The Google Earth Cache – Basics

When you view a location in Google Earth, it caches the imagery data (but not the elevation data), storing it locally so that as you scroll back and forth across different areas, it doesn’t have to download the same imagery over and over again from the server on the Internet. There are actually two sets of locally cached data:

Memory Cache: Data stored in system RAM. This information can be retrieved very quickly, but vanishes when you exit the application.

Disk Cache: Data stored on the hard drive, and which persists after program exit. So if you have data cached for a particular area in Google Earth, exit the program, and then return to the same area the next time you use Google Earth, GE will load the imagery information directly from the hard drive cache – a lot faster than having to download it again over the Internet.

The size of these caches can be set in the Tools => Options section, under the Cache tab:

Google Earth cache options

The maximum values are the ones above, 500MB for memory cache, and 2GB (2000MB) for disk cache; apparently, Google doesn’t want people to download the entire imagery dataset for the whole planet to their systems :). If you’ve got the disk space, and most modern systems do, you should definitely set the disk cache size at this maximum value. Optimum value for the memory cache will depend on how much RAM you have installed on your system, and how much your OS uses. If you have a system with a relatively small amount of RAM (512 MB to 1 GB), making this memory cache too large might impede performance. On most modern systems, with 2GB or more of RAM, the maximum memory cache size of 500MB shouldn’t cause any problems.

Disk cache data is stored by default in the C:\Users\your_user_name\AppData\Local\Google\GoogleEarth directory in Windows Vista.If you can’t find it there, you can determine the actual location using the registry entry HKEY-CURRENT-User/Software/Google /Google Earth Plus, under the CachePath entry. There are two files: dbCache.dat which contains the actual data, and dbCache.dat.index, which presumably is the index file for the data. You can clear out all the disk cache data using the “Clear disk cache” button, which removes all the data but keeps the files there. To delete the files completely, you need to either log out of the server (File => Server Log Out) and then click the “Delete cache file” button you see above, or exit Google Earth and delete those two files directly from the cache directory. You can also copy them to another directory to hang on to them.

Why would you want to delete or copy these files? Two reasons:

1. If you’re having crashing or graphics issues with Google Earth, Google recommends deleting the disk cache files as one possible fix.

2. You can “pre-cache” a set of data for a particular area of interest, then copy them to a different directory on your hard drive. Then, when you want to look at this area in detail in Google Earth, you can copy these files back to the original directory, and Google Earth will access this data from the hard drive, a lot faster than downloading it again from the Google Earth server. If you have a decent Internet connection all the time, this is likely to be more trouble than it’s worth. But if you have a slow connection, this can speed things up enormously. And if you’d like to use Google Earth on your laptop, in a location that has no Internet connection, using cached data is your only option; Google Earth can access and use cached data when no Internet connection is present or available. You can copy this cache data from one computer to another as well.

Note: This only caches image  terrain data from Google Earth, not data from KML/KMZ files. If the KML/KMZ files are self-contained, you can load them into Google Earth and view the data, but if they’re network links, and you’re not connected to the network, the data in the links won’t show up.

Coming up next: how to cache Google Earth data manually.




Using Apple And Online Tools With Google Earth

I haven’t posted much about Apple-related geography tools on this blog, for two very good reasons:

1. I don’t own any Apple hardware (Mac, iPhone or iTouch)

2. There’s a lot less geographically-oriented software available for the Mac than there is for Windows, or even Linux

But Stefan Geens, who runs the Ogle Earth blog, does have a Mac and and iPhone, and posts regularly on geographic applications for those platforms, usually Google Earth related. And he’s just put up several posts (one, two, three) on how he used these tools along with Google Earth to document a trip in Egypt to visit a number of archaeological sites. The series is very much worth a look, even if you don’t use Apple products:

– The trip itself, and the locations documented, are incredibly interesting, especially if you’re into Egyptian archaeology. In particular, the cubic panoramas embedded in the file, using 360cities.net, are jaw-droppingly spectacular. Stefan documents his panorama-creation process here.

– A number of the tools used are online-based, so they’re not tied to Apple platforms and can be used by anyone

– Valery Hronusov posted a few days ago on his blog about using the DropBox service (free for up to 2 GB of data) to sync a KMZ file on your desktop to your DropBox account, and then create a publicly-accessible URL link to this file that anyone can access. Stefan created such a link to his Egyptian travelogue, demonstrating how you can now have an Internet-accessible KMZ link that updates automatically whenever you change the matching file on your desktop; no FTP or other file upload process required. KMZ is a better choice than KML for most cases, since it compresses the file and also incorporates all of the supporting materials (like photographs).

– Stefan also uses the caching capability of Google Earth on the iPhone, storing GE data for the locations he was going to visit using a WiFi link for use when he couldn’t get a good connection, or when it would have been expensive to do so. This is a good technique to use with Windows laptops as well, if you’d like to use Google Earth in a location where an Internet connection is either unavailable or expensive. I’ve been meaning to do short series on this for a while, and this is as good a prompt as any, so the rest of this week’s posts will be on using Google Earth’s caching capability on a Windows system.




Another New MapChannels Feature: Geography Quiz Maps

In addition to the new TeamMaps feature, MapChannels has a new embeddable geography game called QuizMaps:

Choose World or State Capitals, and get a world/US map with letters plotted at various locations, as in the example screen capture below:

MapChannels geography quiz

Unscramble all the letters to get the correct answer; one of the letters is plotted at the same location as the answer. Panoramio photo clues from the answer location can show up on the left, but are usually as useless as the example you see above. The correct answer to the image above is left as an exercise for the reader.




Visitor-Editable Google “Team Maps” At Map Channels

The MapChannels website has a new feature called “Team Maps”, which lets you create an embeddable Google Maps view which visitors are free to add their own annotated markers to. From the website, features include:

  • (1) Create a new empty Team Map, (2) create a map from an existing KML or (3) create a map using a pre-defined event venue map data
  • Customizable data schema – allowing you to define a set of data fields for your place markers
  • Customizable info window and tooltip contents – use javascript template code to format your data schema
  • Pre-defined javascript template functions to display images, YouTube videos, website thumbnails and RSS feeds within info windows
  • Define the set of icons that can be used for map markers
  • Optionally select other Map Channels users to be an admin or editor for your map
  • Review user edits before applying any changes to your map
  • Lock the map to disable map editing by users
  • Automatically generate KML, GeoRSS and Tab-delimited text feeds for your map data
  • Import data from KML files (e.g. Google My Maps) or tab-delimited text (Spreadsheet) files
  • Embed your Team Map into a web page using a single line of HTML code. This code uses an IFrame, the URL within the IFrame can include parameters allowing you to display a specific place on the map (plus other options).

Here’s a simple active  map I created to test the service. The initial display bounds for the map are set automatically by the loaded data; for this map, I’ve added two placemarks already to set those bounds:

As a viewer of the map, you can submit a placemark for entry on this map using the “Add Place” link at the upper right; it lets you add not just a marker, but also a name, description, web link, and note for the map creator/editor:

1-7-2009-10.43.05 PM

You position the marker by dragging it on the map to the desired location. Once done, click on “Complete”, and your placemark is submitted to the map’s creator for review and approval before it shows up on the map. Feel free to add a placemark to the above map to try it out, but don’t look for it to show up – I won’t be reviewing/approving any submissions on this test map.

Current limitations (from the website):

  • Only markers (points) can be added to a Team Map. Lines and polygons are not yet supported
  • Team Maps are suitable for map collections of up to 500 markers, performance will be affected when you use a larger number of markers.
  • Please contact (MapChannels) if you are getting more than 5,000 page views per day for maps, this assists in planning server resources.



Online Tilt-Shift Photo Maker

There’s been a mini-craze online for creating tilt-shift photos, where the focus position and depth of field on a landscape/cityscape are manipulated to make the picture look like a miniature reproduction. For authentic tilt-shift photos, you need a special lens, but you can re-create the effect using Photoshop filters, or by following tutorials online. Now there’s an online website called TiltShiftmaker that lets you upload your own photos, and applies a tilt-shift effect to them:

Original photo from the island of Santorini (from Flickr):

1361244291_49b0773bc7_b

Run through TiltShiftmaker:

santorini

The process works best on images that don’t have a few objects much taller than the rest of the scene, as that can result in the base of the object being at a different focus/blur than the top.

Via Lifehacker.




Garmin Topo Maps For Afghanistan, Baghdad

Just noticed on the GPSFileDepot site that they’ve started posting 20-ft.-contour topographic maps for Afghanistan for Garmin GPS units, created by Steakhouse Studio. Here’s a MapSource screenshot of the Kandahar area:

Garmin topo map of Afghanistan

Twenty-five topo maps are currently available, covering one-by-one or one-by-two degree quadrangles; by my best estimate, this covers roughly a half of Aghanistan’s territory, but it looks like new maps are being added on a regular basis. The link page also include road maps for Afghanistan as a whole, and for metro Kabul.

Also at GPSFileDepot is a Garmin topo map for the Baghdad, Iraq area, with 20-ft. countours, roads and points of interest. Plus, there’s a permanent download page for the routable Garmin map of Baghdad mentioned in an earlier post.

Windows and Mac installers available for all these mapsets.

Addendum (5/22/2009): An upgraded set of these maps is available for US Government use only; contact the author for info.




Downloading MapQuest, Live Search Results To A Garmin GPS

A while ago, I covered the process of downloading a Google Maps search result to a Garmin GPS, using the Garmin communicator plugin. The Garmin blog has posted videos on how to do the same thing with Microsoft Live Search:

MapQuest:



and Google Maps as well:



You will need to have downloaded and installed the Garmin Communicator plugin first; versions are available for both PC and Mac.




Removing WordPress Cruft

In addition to the Internet connectivity issues I had earlier this month, I got zapped by a major website issue. My hosting service claimed that my WordPress blog had a problem either with its mySQL databases, or with malformed queries that resulted in an abnormally-heavy server load. They said it was so bad that they had to shut down my account completely for about 4 hours on December 23rd to keep the server running. I took a look at the queries, and didn’t see any problems with them, and a brief inspection of the mySQL databases didn’t show anything wrong. But to make sure that was the case, and to keep my hosting company happy, I took a deeper look at my blog to see if there was anything I could do to remove any cruft that had built up in my blogfiles since I switched to WordPress in June 2007. This isn’t exactly geography-related, but I thought that some WordPress users might find a description of what I did useful.

1. First, I de-activated unneeded plugins. I’ve tried numerous plugins in the year-and-a-half since switching to WordPress, and had pretty much already settled on a core group of eight useful plugins. But there were a couple that weren’t completely necessary anymore, and de-activating them was likely to lessen the server load.

2. Next, I backed up the mySQL databases before trying to work with them, in case something got screwed up. Many hosting companies offer access to control panels like phpMyAdmin that lets you do this. But if you don’t have this access, or if it’s too complicated, there’s a free WordPress plugin called WP-DBManager that lets you create DB backups from the WordPress dashboard, and restore them if necessary (along with some other useful functions).

3. When a WordPress site loads, it reads the wp_options database for configuration data for both the basic site, and plugins. There should be no more than a few hundred entries in this table at most, and the bigger it gets, the longer a site takes to load. Here’s the story of one site owner who discovered that there were over 19000 entries in this table, most of them unnecessary RSS hashes; another source of unneeded entries are from plugins that created them when installed, but didn’t remove them when de-activated. There’s a plugin called Clean Options that does a good job of finding most unneeded options entries based on whether there are any active plugins that use them. Running this plugin reduced the number of wp_options entries on my site from 355 to about 250. But it also found an erroneous blank entry, but didn’t offer a way to remove it. Once you’re finished with this plug-in, it’s OK to deactivate it until you need it again.

4. Going into phpMyAdmin and manually browsing the wp_options table, I found and deleted the blank entry. But there were also about 50 additional table entries for deleted plugins that Clean Options hadn’t found, so those were deleted as well.

5. The wp_posts table contains individual entries for all the posts, pages and images on the blog. The total number of entries was 2700, which seemed high since there’s fewer than 600 posts on this blog to date. An examination of the entries by title showed why – there were numerous duplicated title entries for many of the posts. A bit of research turned up the reason. WordPress 2.6 introduced post versioning, which seemed like a good idea to me. But with every revision to a blog post, even a minor tweak, a new database entry was created for that revision. This was making the wp_posts database table grow a lot bigger than it really needed to be.

WordPress knows about this, but decided that the feature was so useful, and the overhead associated with the larger table so minimal, that they didn’t include the option to turn off versioning, nor to delete unneeded versions. Fortunately, there’s a plugin called Disable Revisions that not only disables revision versioning, but deletes all the revision entries in the wp_posts and wp_postmeta tables. Make sure you backup your database first before activating the plugin, as it does the deletion as soon as it’s activated. Installing and running this plugin decreased the table size by about a third, from around 2700 entries to roughly 1800.

6. I also found a number of database tables created by plugins that were no longer present, and dropped those. The default WordPress installation only has 10 database tables:

  • wp_comments
  • wp_links
  • wp_options
  • wp_posts
  • wp_postmeta
  • wp_terms
  • wp_term_relationships
  • wp_term_taxonomy
  • wp_user_meta
  • wp_users

Any other tables were most likely created by plugins. Usually the name is enough to let you figure out which plugin created it, but if not, just Google the table name. If it was created by a plugin that’s no longer installed, you can probably drop it (but always backup first).

7. I then checked and optimized the database tables using phpMyAdmin; the WP-DBManager plugin can do that as well.

8. Finally, I found useful suggestions at this site and this one for speeding up page loading. For example, in the WordPress theme header and footer sections, php code is used to insert web addresses for style sheets, RSS feeds and coding. But these addresses are normally static, and you can speed up the loading process by replacing the php code that pulls up the address with just the address text itself. For example, the original code for specifying the CSS sheet for this blog was:

<link rel=”stylesheet” type=”text/css” media=”screen” href=”<?php bloginfo(‘stylesheet_url’); ?>” />

By opening my blog’s home page, and using the View => Page Source option, I found that the stylesheet’s static URL was

https://freegeographytools.com/wp-content/themes/K2/style.css

Replacing the php code with this static URL, I get:

<link rel=”stylesheet” type=”text/css” media=”screen” href=”https://freegeographytools.com/wp-content/themes/K2/style.css” />
Because the php code doesn’t have to be interpreted to retrieve the URL, the page loads a bit faster for every case where you can do this. I also dropped several unneeded lines of this type, such as the one that retrieves the WordPress version number and inserts it into a meta tag. Getting rid of this not only speedsup page loading, but improves your site’s security. If a security flaw is found in a particular version of WordPress, the version meta tag can tell an intruder instantly whether your site is vulnerable. If the tag is missing, it’s not as obvious whether your site still has this vulnerability or not.

Did all this solve my site problems? Don’t know yet; I’m getting fewer mysql_slow_query log entries, but haven’t gotten rid of them entirely. But I suspect that’s a server-related issue, which I can’t do anything about. I can say that my blog pages load in about half the time they used to in Firefox, and a third of the time in Internet Explorer, so presumably that reflects a reduction in my site’s load on the server.

Hopefully now I’m done with all these issues, and can get back to geographically-oriented posts on a more-normal schedule.