tf2bsb - TerraServer Maps to BSB Charts



Aerial Photos and Topo maps displayed in Marine Navigation programs


WARNING: This is not for the faint-harted. If you don't know your way around computers, don't try this. And don't call me for help.

And sorry, I have been adding to this page and not cleaning up. It is disorganized. But as I have had no one express interest in this process, I have no incentive to fix it up. If interest is shown, I'll clean it up and do some better documentation.

I wrote this for myself. If enough people are interested in it, I will clean it up and make it a little easier. Might even find a way to make it run under Windows without loading MinGW.

But, seriously, if you have questions or comments, e-mail me (link at the bottom of the page). Just don't demand that I make it work for you.

Download tf2bsb.zip here (321k - unzips to 1.1mb)


This outlines a process to get B&W and Color aerial photographs and color topographical maps from the Terraserver and display them using marine navigation software.

Windows Requirements:
All the above are free and can be found and downloaded. If you are not familiar with Unix, the installation of all this is not trivial. I'm sorry, but I CANNOT provide support for downloading or installing any of the above. As far as that goes, I don't officially support any of what follows, but feel free to e-mail me with questions. Better still, join us at the Cruisers Forum. That link will put you in the OpenCPN section. There is a thread on charts which is where this stuff is discussed.

In my first automated run creating B&W photo charts I created 150 charts in less than an hour. Actual time was the time to create the region in USAPhotoMaps (2-3 minutes) and 48 minutes for the batch processes. And that is on an old 2.4gh P4 machine. A total of 634mb of charts, about 4.5mb each.

Before I go further, this requires Windows and MinGW/MSYS. So if you're on *nix, sorry (Unless you got wine or the like). And if you have issues installing a *nix type emulator and packages on your Windows machine, sorry there, as well.

I'd be a little surprised if anyone wants this, but I'm be posting it on my website just in case. If any interest is show, I'll clean it up a bit so it's not so picky on directories, etc. (Actually, it now uses an ini file for directories)
As I have it set up, it uses these directories.
Here are the steps. I said almost totally automatic. There is no coding or number ciphering. Just 5 separate steps. (This assumes you've already downloaded the images with either USAPhotoMaps or TerraFetcher)
  1. Edit the ini file. Instructions are in there. You MUST edit this to put in the proper directory for your USAPhotoMaps.
  2. Use USAPhotoMaps to create a TerraFetcher.txt region file of the area you want the charts to cover. This is just a click and drag to define the region.
  3. From MSYS, run custom program cvtdrv.sh to create some driver files. It generates the file names based on the UTM positions, so there will never be a duplicate file name. It will create ./crtbatch.sh and ./work/terrafetcher.txt. It also copies the TerraFetcherRegion.txt to ./work/TerraFetcherRegion.txt
  4. Run TerraFetcher and select JPEG, then select /work/terrafetcher.txt as the batch file. Run it. This creates all the jpegs in the /work directory.
  5. From MSYS, run cvtbatch.sh. This will copy files from the USAPhotoMaps (if needed - see note below), run the conversions, and put the finished charts in ./BSB_ROOT. They are 3000x2000 pixles.

It cleans up after itself, so all that's left on disk are the .kaps in /BSB_ROOT. (And those two little text files in ./work)

NOTE: There is quirk to TerraFetcher. tf2bsb handles it just fine. But if you are watching directories while things run, you may notice a strange behavior. If you go in and choose the directory for the region file, then run it, you'll notice the jpgs will be created in the directory the region file was in. If you exit TerraFetcher, when you go back in, the region file will still be defaulted to the one you chose. HOWEVER, it will put the jpgs in the USAPhotoMaps directory. Bummer. The tf2bsb code looks in the ./work directory. If it can't find it there, it will grab if from the directory in the ini that is set for the USAPhotoMaps directory.

Knowing the way I code, and the fact that this is the first time I ever coded more than 10-20 lines in C, it may be a while before I'm ready to post it.
The reason I say I'll be surprised if anyone wants this, is this. Look at the screen shot below. That little block of red outlines is 634mb. Lot of disk space for a little area. I'm gonna do Lake Lanier and Charleston Harbor, next.

The Terraserver has 3 different types of maps in 2 different resolutions (MPP is Meters per pixel).

Topo maps in color - 4 MPP and 64 MPP
Photos in B&W - 1 MPP and 8 MPP
Photos in Color - 1/4 MPP and 4 MPP

The files below are from the highest resolution for their type.


File names:
The _t is a topo map in color.
The _p is an aerial photo in B&W.
The _u is an aeriel photo in color.

The file extensions:
.txt - This is the file I created to get Terrafetcher to create the 3 files below.
.inf - I don't think this is needed. Just internal use
.jgw - This is the World file with the geo-referencing
.jpg - This is the jpg.


The images are downloaded as square tiles. The Topo map below is exactly 2x2 tiles wide. When you create a large .jpg, it takes the coordinates and includes all the tiles that contain any portion of the area you selected. For the below images, I used the same coordinates, but since there was overlap, the images cover different areas. When (if) I create a procedure to batch-create the images, I'll calculate the coordinates so they each cover a set group of tiles. Probably 5x7 tiles for each .jpg. 5x7 tiles will fill a 1280x1024 screen. Sorry, I don't remember the exact size, I'd have to go back and calculate it. These photos should show up about 30 miles NW of Atlanta, GA. om the SE portion of Lake Allatoona.

The Topo color map
ramp_t.txt - 1KB
ramp_t.inf - 1KB
ramp_t.jgw - 1KB
ramp_t.jpg - 60KB (400x400)



The B&W photo
ramp_p.txt - 1KB
ramp_p.inf - 1KB
ramp_p.jgw - 1KB
ramp_p.jpg - 174KB (1000x1000)



The Urban color photo
ramp_u.txt - 1KB
ramp_u.inf - 1KB
ramp_u.jgw - 1KB
ramp_u.jpg - 1,326KB (3600x3000)



If you have comments, e-mail the Webmaster