[gdal-dev] Erdas .img format (HFA) overview troubles

Even Rouault even.rouault at mines-paris.org
Mon Jun 1 12:09:49 EDT 2009


Christiaan,

I see this in hfadataset.cpp :

CPLErr HFADataset::IBuildOverviews( const char *pszResampling, 
                                    int nOverviews, int *panOverviewList, 
                                    int nListBands, int *panBandList,
                                    GDALProgressFunc pfnProgress, 
                                    void * pProgressData )
    
{
  ...
    if( GetAccess() == GA_ReadOnly )
        return GDALDataset::IBuildOverviews( pszResampling, 
                                             nOverviews, panOverviewList, 
                                             nListBands, panBandList, 
                                             pfnProgress, pProgressData );
   ...
}

So with gdaladdo -ro, it defaults to GDALDataset::IBuildOverviews(), that will 
fail because the default overview mechanism isn't initialized as Frank noted 
below.

What you want to use is the HFA_USE_RRD global config option (documented after 
the list of creation options)

gdaladdo --config HFA_USE_RRD YES test.img 2 4 8


Even

Le Monday 01 June 2009 17:52:43 Frank Warmerdam, vous avez écrit :
> Christiaan Janssen wrote:
> > On the page http://www.gdal.org/frmt_hfa.html, it mentions the creation
> > of .ovr files under the Creation Issue section.
>
> Christiaan,
>
> I have removed this inaccurate comment.
>
> > Also, am I wrong in thinking
> > the command "gdaladdo -ro test.img 2 4 8" should have at least generated
> > an .aux (or .rrd) file and not errored the way it did? Thanks.
>
> The error message was unhelpful, but I presume the issue is that overviews
> cannot be generated in a read-only file.  If you would like to file a
> ticket on this, I could look into more appropriate error handling.
>
> I would add, if you wanted ovr support it should be relatively trivial for
> you to add it in your local build with a call to initialize the
> overview manager at the end of the Open() method.
>
>      poDS->oOvManager.Initialize( poDS, poOpenInfo->pszFilename );
>
> I am hesitant to do this in the mainline code though.
>
> Best regards,




More information about the gdal-dev mailing list