Opened 9 years ago

Closed 9 years ago

#3776 closed defect (fixed)

Unreadable Swedish BSB file is readable with OpenCPN

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: BSB
Cc: chrisbarker, manimaul, hamish

Description

The BSB file in:

http://www.hydrographica.se/images/BSB-demo.zip

is not readable with GDAL. It errors out at line 128. (tested with 1.5, 1.6, 1.7 and trunk) The same file works ok with OpenCPN (http://www.opencpn.org/) so it is apparently not irretrievably corrupt.

Originally this came up during investigation of #3409.

Change History (2)

comment:1 Changed 9 years ago by warmerdam

Status: newassigned

I see OpenCPN is using highly adapted GDAL code, particularly for the BSB reading, in src/chartimg.cpp (See ChartBaseBSB::BSBScanScanline() and nearby functions).

comment:2 Changed 9 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

I have come to the conclusion that the folks who produced this file just didn't understand how to properly encode the line numbers. I have found the image reads just fine if you ignore the line numbers being wrong.

However, I am not really willing to ignore line number errors in general, as they seem like one of the few mechanisms to discover if a file is corrupt. So I'm leaving this as an error, but providing a configuration option, BSB_IGNORE_LINENUMBERS, that will ignore problems with the line numbers. The original error message mentions this option now. If such files prove to be common we may want to alter the behavior.

An inspection of OpenCPN code shows that line numbers are not checked which is why it works fine.

The "fix" is r20803 in trunk.

Note: See TracTickets for help on using tickets.