Wouldn't it be nice to use those beautiful copyrighted satelite images from Google in planning your routes inside your chart plotter program? Well with the technique presented here you can take any graphic file (PNG, TIFF, etc.) and convert it to a geo-referenced chart that you can import into your chart plotter program.
As a disclaimer I should state there are probably some restrictions on how you can use Google Earth images off-line. I did some research on google's site but could not locate anything specific that would be violated by the information I present here. While Google's policies in using their copyrighted images are pretty liberal, you should be aware that there could be something they dissapprove of. And if requested by them I will remove this information.
Make your own chart
This is a technique to convert images into geo-referenced images that can be used on any navigation program that uses BSB/KAP files. For this example OpenCPN was the program used for testing.
In short the steps are:
- Download: IMGKAP is the tool required. On Linux it needs to be compiled and for Windows there is an executable.
- Capture Image: You will need an image to work with that you know its latitude and longitude boundaries.
- Create KAP File: Using the Lat/Lon information we can build the chart data file.
- Test Results: OpenCPN or other tool and import your new chart.
- Example: One last generic example to get you going.
IMGKAP is an open source tool that can convert PNG, BMP, JPEG, TIFF and others to a geo-referenced images by building a .KAP file. Detailed instructions on the tool can be found here. For Linux users you'll need to install libfreeimage-dev and have some sort of compilier installed. Most Linux distros can use the following set of commands in a terminal window (CTRL-ALT-T) to get IMGKAP up and running:
cd [directory where you want to install imgkap tool] sudo apt-get install libfreeimage-dev wget http://www.dacust.com/inlandwaters/imgkap/v00.01.11/imgkap.c gcc imgkap.c -O3 -s -lfreeimage -o imgkap
For windows users there is a pre-complied version that you can download directly. I suggest you put the EXE file in a directory that is easy to type like c:\imgkap\
(NOTE: Your image is assumed to be in WGS84 datum)
In this example I show you a way to get a full size image with Firefox without having to crop or manipulate your image. This reduces mapping errors. In addition the site that you are going to visit to get this image also provides the lat/lon boundaries making errors less likely to occur. Once you have the imgkap tool, you need an image. You can use anything you want to make screen shots. In this example I'll use an on-line program that provides lat/lon boundries and full scree images. To follow my example, you'll need FIREFOX and the add-on: PIXLR-GRABBER (https://addons.mozilla.org/en-US/firefox/addon/pixlr-grabber).
After you've installed and restarted Firefox with the Pixlr-Grabber browse this link: http://www.ptsim.com/sbuilder/gmaps.asp?Lat=40.145486124&Lon=-8.8643789&Zoom=15&T=0 which gives you the image's lat/lon boundaries needed for KAP file.
Note the NORTH, SOUTH, WEST and EAST NUMBERS – you'll need those build KAP file later. You can copy and paste them to save yourself from typo errors. Now change the box from 1600 x 1200 to 3200 x 2400 for the highest resolution. Then click WINDOW. A new window will open with just your image.
In firefox select TOOLS → PixlR-GRABBER → Grab Entire Page Save it in a directory where you want to make some new chart images. In this example I saved it in the same directory as my imgkap tool and called it tryimage.png
Navigate to your image in a terminal window (Linux) or Command Prompt (Windows) and using the NORTH (lat0), SOUTH (lat1), WEST (lon0) and EAST (lon1) numbers, make a KAP file. For this example the data looks like this on the website:
[GEOGRAPHIC] North=40.1553268854503 South=40.13564393961976 West=-8.881545066833496 East=-8.847212791442871So to make imgkap happy we have to tell it what numbers go where. It's format is:
imgkap [options] [input file name] [lat0 lon0 lat1 lon1 | headerfile] [output filename]
We can ignore the options, headerfile and output filename for now. We just need to tell it how to frame the image with lat0,lon0 and lat1 and lon1. Essentially this is the upper left boundary and the lower right boundary. This makes lat0=NORTH, lon0=WEST, lat1=SOUTH, lon1=EAST. In our example this command to type in is (assuming imgkap and your image are in the same directory otherwise you need to provide the path names too):
imgkap tryimage.png 40.1553268854503 -8.881545066833496 40.13564393961976 -8.847212791442871
Imgkap will run for a little while and then exit. You'll now find that the .KAP file has been built. And that's about all there is to it.
You should see your kapfile appear in your directory:
6.4M 2012-01-12 17:10 tryimage.kap 23M 2012-01-12 17:09 tryimage.png
Open up OpenCPN or a navigation program of your choice that can read BSB/KAP raster charts.
In OpenCPN go to Tools->Charts and add the directory that contains the chart we just made. Open closing it should now appear in your chart inventory with lat/lon position data. Since I'm not very familiar with charting programs or OpenCPN I don't know how to do more advanced techniques like overlaying them onto other charts or adjusting other settings, but if time allows I might be coaxed into experimenting with more advanced features.
Now that you have IMGKAP and a way to save Google Earth Images, we can use this technique for making generic charts. In this example we will make a chart for the old harbor entrance in Mazatlan Mexico.
- Go to http://www.ptsim.com/sbuilder/gmaps.asp
- Enter in the box to the left enter 23.17549 and -106.4198 and click GoTo
- Now change the window size to 3200 x 2400 for highest resolution and click WINDOW.
- In the new browser window that opens and select TOOLS → PixlR-GRABBER → Grab Entire Page. Save this in a directory where you would like to create your chart. In this example I saved it as maz_old_harbor.png.
- Notice from the browser that this image is bounded by the following points:
[GEOGRAPHIC] North=23.187312236288893 South=23.163640891346354 West=-106.43696308135986 East=-106.40263080596924
imgkap maz_old_harbor.png 23.187312236288893 -106.43696308135986 23.163640891346354 -106.40263080596924
Now you should have the KAP file in your directory. and the only thing left to do is to run OpenCPN and make sure this directory is in your list of chart directories and it should be automatically loaded and ready to use.
Once you get accustomed to using this tool you can then see how easy it would be to modify the URL to set to different zoom levels. You can also use other sources for images as long as you know the upper right and lower left corner's locations in latitude and longitude.