BSB Reprojector Usage

This is a usage document for version 1.8+ of the BSB Chart Reprojector. The purpose is to document the command-line option flags available for the reprojector. In general, these command-line options are of interest to users who need to reproject multiple files and need options to work in batch scripts. For many users, all the required functionality can be obtained without use of the command-line options; simply double-clicking the executable in a GUI environment (e.g. Windows or X11) will meet their needs. This document is for users who need more input and output options, and the assumption is made that those users are familiar with running programs on the command line.

Name

bsbreprojector - Reprojection program for BSB format files such as nautical charts

Synopsis

bsbreprojector [-t][-r][-c][-o outfile][-v][-p paramfile][-d degree_input_mode] infile ...
 

Options

-toutput TIFF format with world file.
-routput raw format (huge).
-vprint the version number.
-d modespecify how latitude and longitude will be specified. Modes are: 0=+/-DDDMMMSSS.SS; 1=+/-DDDMMSS.SS; 2=+/-DDD.DDD. Leading zeros are ignored and unnecessary.
-p paramfilesupply new projection parameters from paramfile instead of standard input.
-o outfileoutput to outfile instead of requesting file name later.
-callow for compressed read if low on memory. Not recommended; the program seems to be slower even if there isn't much memory. Your experience may vary.

Description

Take one or more input BSB format files and reproject them to the desired map projection.  If multiple input files are given, the output file names will be generated based on a given suffix that will be prompted.  The parameters for the new projection will be prompted for or can be specified with -p paramfile.  The old projection will be determined from the input file itself. Default output is a new BSB file in the new projection. The output can also be set to TIFF or raw bytes (-t and -r respectively).

Installation

There are two components to the distribution package: the executable and this document. You will probably wish to rename the executable to something shorter than the distribution name. The executable may be placed anywhere you desire, but it is most useful to put it somewhere where your PATH environment variable will find it. To find your PATH with Windows, start a command prompt window (a.k.a. DOS window) and use the path command. To find your PATH on a Unix-like system, use the command
echo $PATH.

Once you move or copy the executable to a location where the system will look for it, you can execute it simply by typing its name on the command line. In a GUI environment (e.g., Windows or X), you can start the program by double-clicking on its icon, but you will not have the options provided by the command line.
 

Examples

Simple example of reprojection with prompts for parameters, including output file:
    bsbreprojector 11009_1.kap

Reprojection done using decimal degrees as inputs:
    bsbreprojector -d 2 11009_1.kap

Batch mode done by specifying the input files on the command line and setting parameters by responding to prompts.  The metacharacter usage will only work on Unix-like systems.
    bsbreprojector 11*.kap

Batch mode processing using a shell loop (this is shown as a Unix example, but the idea works in DOS as well).  Assume you have created a file called 'paramfile' with the entries you would normally type in at the prompts.
    for file in 112*.kap
    do
        newfile=`basename $file .kap`_stplane.kap
        bsbreprojector -o $newfile -p paramfile $file
    done
 

The following is an example of a paramfile with comments on each line to explain the input. These comments would not be in a paramfile. Each projection has different inputs and hence the paramfile needed varies. The easiest way to determine the inputs for the paramfile is by running the program and keeping track of your answers. Those answers are the inputs that make up the paramfile.

7 #the projection (Polyconic)
-90000000 # the central meredian in DDDMMMSSS.SSS format
30000000 # the origin of latitude in DDDMMMSSS.SSS format
0 # false easting in meters
0 # false northing in meters
2 # output units are meters
y # change the datum
99 # use datum NAD83
out.kap # output file (not needed if -o option used)
Note: When using the program interactively, there are options to list the datums or zones to get the correct input number. These are typically '-999' to get the list and 'y' to keep paging until you find what you want. These should not be entered into the paramfile.

Limitations

The program was designed to read the BSB format (version 2) NOAA charts and therefore only recognizes for input the four map projections defined for version 2.  Therefore, reprojection of a reprojection is unlikely to work.  This would not be recommended even if it did work.  There may be distributors of images in BSB format that are in other projections, and the reprojector will fail to read them. Version 3 BSB charts will read without a problem as long as they are in one of the original four map projections (Mercator, Transverse Mercator, Polyconic, Lambert Conformal Conic). This should include all NOAA charts.