[gdal-dev] GDAL (via Java bindings) and ECW

Frank Warmerdam warmerdam at pobox.com
Thu Nov 18 11:27:45 EST 2010

Ronan Crowley wrote:
> Hi All,
> I'm using GDAL (via Java) to view an ECW file.
> It generally works fine, however I'm having serious memory issues.
> I have a 6MB ECW file, that when I try to view in its entirety I get 
> OutOfMemory errors.
> The code I'm using to extract the image is pretty much the code from the 
> GDALtest.java file in the swig sub-project.
> What I'm wodering, is if there is any way to get the number of pyramid 
> levels inside the image and grab the top-most pyramid level image ?


The GDAL ECW driver reports ECW files as having "arbitrary" overviews.
That is supposed to imply you can extract data at any resolution efficiently.
I think this is the only driver that works this way and it isn't necessarily
a good thing.

Anyways, you can just pick any resolution you want to load at, and setup
your RasterIO request accordingly.

There have been some reports of high memory use with the ECW driver.  To
some extent this may be the libecw machinery caching some things but it
is hard a 6MB file using all that much memory unless there is a serious

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