<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Greetings,<BR><BR>I have been exploring the
GDAL utilities with a view to creating a general BSB to RLE bitmap converter
that also generates a separate WGS84 worldfile, appropriately transformed
for the datum etc of the original BSB file.<BR><BR>I believe I am getting some
puzzling results from the gdalinfo utility that I will try to explain as
follows:</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV><BR>(1) Environment is Windows XP SP3 and I have installed FWTools
2.2.9.<BR>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV></FONT><BR>(2) I have obtained NOAA BSB chart no 11006 (KEY WEST TO THE
MISSISSIPPI RIVER) from:<BR><BR><A
href="http://www.nauticalcharts.noaa.gov/mcd/Raster/download_agreement.htm">http://www.nauticalcharts.noaa.gov/mcd/Raster/download_agreement.htm</A><BR><BR>scroll
to the bottom then click [Proceed to NOAA RNC(R) (BSB) Downloads] then click
[Textual], the rest is pretty obvious.<BR>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV></FONT>
<DIV><BR>(3) After downloading and unzipping to [C:\NOAA BSB\11006], I inspect
the file [C:\NOAA BSB\11006\11006_1.KAP] with the Windows Wordpad applet, the
first several lines read as follows:<BR><BR>!<BR>CRR/<BR>VER/3.0<BR>BSB/NA=KEY
WEST TO THE MISSISSIPPI
RIVER,NU=44,RA=10967,9389,DU=254<BR>KNP/SC=875000,GD=NAD83,PR=MERCATOR,PP=26.127,PI=60.000,SP=,SK=0.0000000<BR>TA=90.0000000,UN=FATHOMS,SD=MEAN
LOWER LOW WATER,DX=87.50,DY=87.50</DIV>
<DIV>...<BR><BR>I'm guessing "GD=NAD83,PR=MERCATOR" means the file contents are
to NAD83 datum in a Mercator projection.<BR><BR>This file also contains 92
ground control points of the
form:<BR><BR>REF/1,275,8522,24.1668694444,-90.0831111111<BR>REF/2,275,300,30.5834527778,-90.0831111111<BR>REF/3,2427,300,30.5834527778,-88.1999805556<BR>...<BR>REF/92,275,1069,30.0000583333,-90.0831111111<BR></DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV></FONT><BR>(4) I launch the FWTools shell via the [FWTools Shell] shortcut
on the desktop and within the FWTools shell I key:<BR><BR>gdalinfo -nomd -noct
"C:\NOAA BSB\11006\11006_1.kap" > "C:\NOAA BSB\11006\11006_1.txt"<BR>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV></FONT><BR>(5) I inspect the resulting file [C:\NOAA BSB\11006\11006_1.txt]
which shows:<BR><BR>Driver: BSB/Maptech BSB Nautical Charts<BR>Files: C:\NOAA
BSB\11006\11006_1.kap<BR>Size is 10967, 9389<BR>Coordinate System is `'<BR>GCP
Projection = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG",7030]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG",6326]],PRIMEM["Greenwich",0,AUTHORITY["EPSG",8901]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG",9108]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG",4326]]<BR>GCP[
0]: Id=GCP_1, Info=<BR>(275,8522) -> (-90.0831111111,24.1668694444,0)<BR>GCP[
1]: Id=GCP_2, Info=<BR>(275,300) -> (-90.0831111111,30.5834527778,0)<BR>GCP[
2]: Id=GCP_3, Info=<BR>(2427,300) ->
(-88.1999805556,30.5834527778,0)<BR>...</FONT></DIV></DIV></DIV></DIV>
<DIV><FONT face=Arial size=2>GCP[ 91]: Id=GCP_92, Info=<BR>(275,1069) ->
(-90.0831111111,30.0000583333,0)<BR>Corner Coordinates:<BR>Upper Left ( 0.0,
0.0)<BR>Lower Left ( 0.0, 9389.0)<BR>Upper Right (10967.0, 0.0)<BR>Lower Right
(10967.0, 9389.0)<BR>Center ( 5483.5, 4694.5)<BR>Band 1 Block=10967x1 Type=Byte,
ColorInterp=Palette<BR>Color Table (RGB with 12 entries)</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2><<<<< i.e. somehow gdalinfo has
decided that the files contents are to WGS84 datum
>>>>></FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV> </DIV></FONT></DIV>
<DIV>(6) I rummaged through the gdal source and found
[C:\gdal-1.5.3\frmts\bsb\...] which appears to contain the source files for the
GDAL BSB driver(?). </DIV>
<DIV> </DIV>
<DIV>Of particular interest is the file
[C:\gdal-1.5.3\frmts\bsb\bsbdataset.cpp] which contains the line:</DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>pszGCPProjection = "GEOGCS[\"WGS
84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS
84\",6378137,298.257223563,AUTHORITY[\"EPSG\",7030]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",6326]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",4326]]";</SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>which is a dead ringer for the [GSP Projection =...] produced
by gdalinfo.</SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>I am not a C programmer but reading
[C:\gdal-1.5.3\frmts\bsb\bsbdataset.cpp] and
[C:\gdal-1.5.3\frmts\bsb\bsb_read.c] it looks to me suspiciously like the
GDAL BSB driver forces the gdalinfo datum to WGS84 regardless of what it truly
is.</SPAN></DIV>
<DIV><SPAN lang=EN>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV> </DIV></FONT></SPAN></DIV>
<DIV><SPAN lang=EN>(7) I am led to believe that NAD83 is to all intents and
purposes WGS84 so I guess there is no harm done if all BSB charts were NAD83 or
similarly "WGS84 compatible". </SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>However if you go to:</SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN><A
href="http://www.digitalocean.ca/digitaloceane-store/bsbraster.asp">http://www.digitalocean.ca/digitaloceane-store/bsbraster.asp</A></SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>you can obtain BSB charts for areas totally divorced from
NOAA (and therefor presumably NAD83 and similar).</SPAN></DIV>
<DIV><SPAN lang=EN></SPAN> </DIV>
<DIV><SPAN lang=EN>My concern is that I could be in the situation
of trying to use the GDAL utilities to convert (say) some New Zealand BSB charts
that use a datum that is not "WGS84 compatible" but the GDAL
utilities force the datum to WGS84 without any appropriate
transformation.</SPAN></DIV>
<DIV><SPAN lang=EN>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------</FONT><FONT
face=Arial size=2></DIV>
<DIV> </DIV>
<DIV>Any and all comments welcomed - I do hope I haven't missed something
embarrassingly simple in this great monologue...<BR></DIV></FONT></SPAN></DIV>
<DIV></FONT> </DIV></FONT></DIV></BODY></HTML>