Creating Links to PDF's of boring logs in Google Earth

This is a copy of a post from the old gINT forum so some of the information may be a bit dated but most should still be applicable. It is relevant to some of the current discussions in the forum.

Just wanted to relate some of my experiences in setting up place marks for test borings in Google Earth that contain a hyperlink to a PDF of the boring log stored on a local server.  This can then be used as a convenient boring log retrieval system.  All the boring locations are displayed in google earth as a place mark. When the place mark is clicked in google earth the pop up balloon displays a link to the bring log.  Clicking on this link displays the boring log in acrobat reader.

First, a note on google earth versions

  • Version 4.2 allows access to local files and works fine
  • Version 4.3 does not allow access to local files at all (in the name of security)
  • Version 5.0 allows limited access to local files, but not by default.

Thus to make this work, you need to do the following:

  • Upgrade to Goggle earth 5.0 if you have an earlier version
  • Start Google earth and Under Tools, Options, General tab, make sure the following are checked:
  • Display box - "Show web results in external browser"
  • Placemark balloons box - "Allow placemark balloons to access local files and personal data"
  • click Ok and exit google earth

1. To create the pdf files of the boring logs, use the create pdf button in the output tab of gINT but select the option to create individual files from each data set.  Use the default file name expression as <<Point.PointID>> and check the option to replace spaces with underscores (more on this later).

2. You will need to create a field in your points table that contains the description for the kml file.  This field needs to contain the following text:

<a href=”[pdf file name]”>Link to Typed Boring Log</a>

Where [pdf file name] is the actual name of the pdf file created of the boring log.  This is a simple html hyperlink anchor.  You can get fancier if you want.  There are several ways to create this field.  The simplest way I have found is to copy all the Point ID’s from gINT to excel (or export them), write a formula in excel to build the text string, and paste the resulting text strings back into gINT. If you have pasted the boring names in column A of excel, the following formula in column B will create the required text string.

=”<a href=”””&A1&”.pdf””>Link to Typed Boring Log</a>”

The triple and double quotes are required to create a single quote within the quoted text string.  If the boring names contain spaces, you will have to first search and replace the spaces with underscores.  This is required because google earth’s parser does not seem to recognize spaces in file names properly. (remember that we already created the pdf files with spaces replaced by underscores)

This could also be done using a simple gINT rule.

NOTE: If you are creating PDF's from multiple projects to be combined into a single kml file you will need to add a unique project identifier to the PDF file name and the link created above must be modified to include this unique project identifier.  This is required beacause the method described requires all PDF files to be placed in the same directory and if two projects have a boring with the same name (for example "TB-1.pdf") there will be a conflict.

3. Now configure the goggle earth setup in gINT to use the created field as the icon description under the Icon and description tab.  Configure any other options you need or want as well.

4. Create a kml file by selecting view borings in google earth.

5. Place the created kml file in the same directory as the pdf files of the boring logs.  This can be a local directory or a directory on a LAN server.  The kml file must reside in the same directory as the pdf’s to avoid file path issues in the links (note the link created above does not contain any path information).

6. Finally create a shortcut on your desktop to the kml file

Clicking on this shortcut should launch Goggle Earth with the borings displayed and the links in the pop up balloons working.  Clicking on a boring will display the pop up balloon that contains the Hyperlink text “Link to Typed Boring Log” (see picture below). Clicking on the “Link to Typed Boring Log” text in the pop up balloon will launch your browser with the pdf file.  Your browser will then display the pdf file using acrobat reader.

  • The links in the kml file contain no path information so they rely on the fact that google earth looks in the same directory as the kml file if it finds no path information. That is why the kml file MUST be in the same directory as the pdf's. When you save the original kml file into your "my places" it gets merged with your myplaces kml that is stored in a default location on your computer (search for the file "myplaces.kml" on your computer if you want to know where it is...it varies by operating system and google earth version). Google earth automatically loads the myplaces kml when it starts but since the pdf's of the boring logs are not in the same directory as the myplaces.kml the links will not work.

    To get around this, I simply create a shortcut on my desktop to the original kml file in the directory with the boring log pdfs (Step 6 in the original post). Clicking on this shortcut starts google earth with the project kml file already loaded and the boring log links working. (it also loads your myplaces kml). I have a shortcut for each project that I am working on placed on my desktop. If the kml and pdf's are located on a networked drive, multiple users can create similar shortcuts on their desktops to access the boring information using a google earth interface. Just remember to set the google earth options on each users machine as described in the previous posts.
  • I'm having difficulties opening linked files from the snippet shown in the places pane in Google Earth. The links will open from the description in the placemark balloons but not from the snippet in the pane. This was not happening when I originally created the links, though. Is there a way to fix this?
  • I have been able to duplicate this behavior by unchecking the "Show web results in external browser" box in google earth under Tools, Options, General Tab. This box should be checked per the instructions in the original post to force the PDF to display in a separate window rather than in the google earth map pane. Not sure why this causes a problem but check it and see if it resolves your issue.
  • What you suggested worked when I tested that on a google earth file with direct file paths in the reference links, but when I tested it in my file with relative file paths in the reference links, it didn't work. Do you know if relative references just don't work in snippets, or is there a work-around I could try?
  • Based on your description it appears you are trying to include full file paths to your pdf files of boring logs. Back many moons ago (when I first posted this) I had gone through a long process of trying to incorporate file paths into the link. I had many issues with google earth not interpreting the file path correctly. Spaces in the file path caused issues, special characters in the file path caused issues, mapped drives in file paths caused issues. I finally decided that not using file paths and simply placing the kml file in the same directory as the pdf files was the way to go. This allowed me to easily move the boring logs and kml to any location I wanted to without needing to change the links. I could load as many kml's as I wanted to for different projects in google earth and they would all find their own respective pdf's even if they were in different directories. And, when our IT people decided to change our network directory structure, it was not a big deal; once I fond the new path to the kml every thing worked fine. I could even place the directory containing the pdf's and kml on a CD or flash drive for off-line use. And finally, the gINT project file did not need to contain path information so it also was easily transportable to other locations and other servers. This is why the original post was written to not include file path information in the link.

    I would hope that google earth's html interpreter would have improved since the original post and perhaps now file paths can be reliably incorporated into the links but I have not explored that option recently. Not using file paths and placing the kml in the directory with the logs has provided all the functionality I have needed so far. If you want to break your boring logs down into to subgroups with each stored in it's own directory, simply create a KML for each subgroup and then open each kml on start.

    If you find you can reliably include path information, please update this post with your findings.