Trail Map Image to Google Earth
The idea of taking PDF or PNG/JPG based trail maps from anywhere you can find and loading them into Google Earth (GE) on your mobile device to give you a live GPS trail map.
Basic tools you need:
- A “KMZ Builder” - to turn the raw image into a KMZ file. The primary task here is mapping specific pixel points on the image to their real life lat/long. The easiest freebie I’ve found so far is Google’s Custom Maps tool for Android. It sounds like ArcGIS also provides this capability but that’s a fat commercial PC package.
- A “KMZ Loader” – for whatever idiotic reason current versions of mobile GE only load KML’s not KMZ’s. PC GE actually does load KMZ’s directly so maybe there’s hope this will fall away in future revisions. Here are Android and iOS KMZ loader apps that have worked great for me. I believe they simply extract the KMZ and feed the contents to GE automatically behind the scenes. On Android the dang thing works by firing up a mini web server to provide the KML how GE wants it… amazingly GE will only retrieve these suckers from a web URL, not a local file.
KMZ’s are convenient in that they carry the KML and the map image file together in a ZIP package. KML is just some simple xml describing pertinent info like the lat/long points and an href to the image file. If you’re curious about the KML, just rename the example .kmz file linked below to .zip and take a look at the very simple contents in notepad.
The greater Seattle area obviously has tons of cool trails… we’ve been exploring Whidbey Island lately… but I’m not finding much of any of them logged in the Garmin products I have nor on Open Street Maps. *BUT* there does seem to be decent trail coverage provided from PDF/image based trail maps on all the various federal/state/county .gov sites. And that’s where this little approach comes into play.
Taking the basic approach to the next level - Photoshop the original map image such that there is only the raw trail lines sitting on top of a transparent background. The result looks pretty dang good when loaded into GE. Tip: Use the Select > Color Range menu, hit the white background of your map with the eye dropper and play with the “fuzziness” slider. You’ll get all of the background selected to where you can hit CTRL-X to delete it leaving the trails freestanding on transparency (save as PNG file format). CTRL-SHIFT-I to invert the selection to only the trails and then Image > Adjustments > Replace Color to flip the lines from black to white to make them stand out when overlayed onto GE.
Here’s an example KMZ I’ve slapped together from this source PDF. You may notice it’s not quite lined up, I believe it’s only a matter of taking more care when using the Custom Maps tool… but it should give you the idea. If you load GE on your PC, you’ll be able to double click this file to see what I’m saying. It all rotates in 3D and even gets “clamped” to the terrain! From what I can tell, once GE has cached your tiles, you can count it working offline.
Before | After |