[Gdal-dev] gdal_translate bsb files problem

Frank Warmerdam warmerdam at pobox.com
Tue Feb 18 22:51:40 EST 2003


Garvan Keeley wrote:
> Hi,
> I am having some problems using gdal_translate with BSB files.
> 
> I have two files that I have been able to open with a commercial viewer
> (Caris Easy ENC) but are causing errors with gdal_translate.
> 
> File #1:
> - no errors reported by gdalinfo
> - gdal_translate does partial read, at about 80% through the processing, I
> get these errors:
> ERROR 1: Got scanline id 0 when looking for 7401.
> ERROR 1: IReadBlock failed at X offset 0, Y offset 7400
> ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 7400
> ERROR 1: Got scanline id 0 when looking for 7401.
> ERROR 1: IReadBlock failed at X offset 0, Y offset 7401
> ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 7401
> ERROR 1: Got scanline id 0 when looking for 7401.
> etc.
> 
> File #2:
> - gdalinfo and gdal_translate give this error:
> ERROR 1: Failed to find compressed data segment of BSB file.
> GDALOpen failed - 1
> Failed to find compressed data segment of BSB file.
> 
> I have put the BSB files (along with some other files that aren't causing
> problems) here:
> ftp://ftp.optech.on.ca/marine/BSBfiles
> 
> Any tips on how I could troubleshoot these problems?

Garvan,

The world.kap file has a bit of junk between the keywords and the beginning
of the image data proper.  I have modified bsb_read.c to skip this (and will
commit it shortly).  Given that BSB is not a properly published format it is
hard to know if this is a problem in my understanding of the format, or if
that file was just incorrectly generated.

The sample1.kap of Puget Sound has an extra zero byte at offset 6617592.  If
I drop it out of the file it reads fine.  I have implemented a hack to work
around this as well, and have committed the changes to CVS.

You can either pick up the fix from CVS, the nightly snapshot that will be
created overnight, or I can email you a new bsb_read.c.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list