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

2010-11-18 Thread Ronan Crowley
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 ?

Thanks,
Ronan
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

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

2010-11-18 Thread Frank Warmerdam

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 ?


Ronan,

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
leak.

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

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


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

2010-11-18 Thread Greg Coats
>From a JPEG2000 image, you can use kdu_expand -reduce to quickly extract an 
>image of the top (or any other) level pyramid. In the example below, I extract 
>from a JPEG2000 image, pyramid level 10 from a 142 GB image in 0.10 seconds. 
>Perhaps you could consider using JPEG2000.
Greg

$ ls -hl dcua0171_BigTiffYes.tif dcua0171_BigTiffYes_rev.jp2
  142G Feb 16  2010 dcua0171_BigTiffYes.tif
   58G Feb 16  2010 dcua0171_BigTiffYes_rev.jp2
$ /usr/bin/time $kdu_expand -i dcua0171_BigTiffYes_rev.jp2 -o reduce10.tif 
-reduce 10
Copying Geo  box info, size = 387
0.10 real 0.08 user 0.02 sys
$ ls -hl reduce10.tif
  143K Nov 18 10:37 reduce10.tif

On Nov 18, 2010, at 10:24 AM, 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 ?
> 
> Thanks,
> Ronan
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

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

2010-11-18 Thread Ronan Crowley
Thanks for the replied Guys.

My use of GDAL is very generic, allowing any end user visuaise any image
format that GDAL supports via a web browser using a Java backing with JNI
bindings to GDAL binaries. (This particular 6MB ECW file is one of hundreds
that I've tested)

The code as-is works for all image formats and for sub-portions of the ECW
file.

I guess my question should be more directed to the Java bindings directly
and if there is anythings that I can do there... As its at this stage
(allocating the Java memory in byte[] that my applicaiton is running out of
memory)

Thanks,
Ronan


On 18 November 2010 15:54, Greg Coats  wrote:

> From a JPEG2000 image, you can use kdu_expand -reduce to quickly extract an
> image of the top (or any other) level pyramid. In the example below, I
> extract from a JPEG2000 image, pyramid level 10 from a 142 GB image in 0.10
> seconds. Perhaps you could consider using JPEG2000.
> Greg
>
> $ ls -hl dcua0171_BigTiffYes.tif dcua0171_BigTiffYes_rev.jp2
>   142G Feb 16  2010 dcua0171_BigTiffYes.tif
>58G Feb 16  2010 dcua0171_BigTiffYes_rev.jp2
> $ /usr/bin/time $kdu_expand -i dcua0171_BigTiffYes_rev.jp2 -o reduce10.tif
> -reduce 10
> Copying Geo  box info, size = 387
> 0.10 real 0.08 user 0.02 sys
> $ ls -hl reduce10.tif
>   143K Nov 18 10:37 reduce10.tif
>
> On Nov 18, 2010, at 10:24 AM, 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 ?
>
> Thanks,
> Ronan
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev