Ticket #2274 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

NLAPS/NDF Bug Fix

Reported by: warmerdam Assigned to: warmerdam
Priority: normal Milestone: 1.5.1
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: NDF NLAPS
Cc: peter.borissow@spadac.com

Description

Hi Frank-

One other thing I forgot to mention. We ran into a bug in the NLAPS/NDF plugin in GDAL. The driver was bombing out on our Landsat 4 test data. The following code was appended to fix the problem in the file ndfdataset.cpp after line 261.

else
{
      char * pszBasePath = CPLStrdup(CPLGetPath(poOpenInfo->pszFilename));
      pszFilename = CPLFormFilename( pszBasePath,pszFilename, NULL);
       CPLFree(pszBasePath);
}

Before, the NDF dataset driver when it encountered an explicit BAND???_DIRECTIVE in the header file would just try to open the file with that file name. If the application’s working directory was anything other than the directory where the band file was (usually the case), the open would fail. The code above modifies driver to prepend the parent directory path of the header file to the explicit band file name. This modification has been tested and works. Is this something you could add into the next release of GDAL?

Thanks Again, Peter

Change History

03/13/08 11:16:48 changed by warmerdam

  • status changed from new to closed.
  • resolution set to fixed.

I have committed a variation on this in trunk (r13993) and 1.5 branch (r13994) as well as added a very brief test of the NDF2 format driver in trunk (r13992).

Thanks Peter!