[gdal-dev] Extracting (arbitrary?) overviews from ECW file

Markus Schneider schneider at occamlabs.de
Tue Sep 10 02:25:41 PDT 2013


Ok, I just tried it out with an example GeoTIFF, and the mentioned
methods seem to benefit from overviews in the file, so it seems to
automatically do the right thing.

Best regards,
Markus

Am 10.09.2013 11:20, schrieb Markus Schneider:
> There's one question remaining:
> 
> Will the mentioned methods automatically select the best-matching
> overview, or do I have to do this myselft in order to achieve the best
> performance?
> 
> This probably doesn't matter to ECW, but to other image formats with
> "real" overviews (such as GeoTIFF), right?
> 
> Best regards,
> Markus
> 
> Am 10.09.2013 11:13, schrieb Markus Schneider:
>> I believe I learned how to do this, so to answer my own question:
>>
>> Some of the Band.ReadRaster(...) methods allow to explictly specify the
>> buffer width and height, e.g. [1]. This allows to extract resolutions
>> that differs from the original image (and the overviews).
>>
>> Best regards,
>> Markus
>>
>> [1] http://gdal.org/java/org/gdal/gdal/Band.html#ReadRaster(int, int,
>> int, int, int, int, int, byte[])
>>
>> Am 05.09.2013 18:01, schrieb Markus Schneider:
>>> Frank,
>>>
>>> thanks for your reply. Could you (or somebody else) give me a few more
>>> details how to get hold of a raster region with a resolution that is not
>>> defined by an overview?
>>>
>>> Currently, I am able to extract regions from an overview using the
>>> following steps (in Java):
>>>
>>> ...
>>>   Dataset dataset = gdal.Open( "dataset.ecw", GA_ReadOnly );
>>>   Band band = dataset.GetRasterBand( ... );
>>>   band = band.GetOverview(...);
>>>   band.ReadRaster(x,y, ...)
>>> ...
>>>
>>> Afterwards, I have the raw data values in my array. It works fine for
>>> any overview.
>>>
>>> My problem is that I cannot figure out how to get hold of a Band for a
>>> non-predefined overview. How would I do this?
>>>
>>> Best regards,
>>> Markus
>>>
>>> Am 04.09.2013 18:15, schrieb Frank Warmerdam:
>>>> Markus,
>>>>
>>>> I believe the GDAL ECW driver will pass RasterIO() requests through to
>>>> the ECW SDK to evaluate meaning that there is no constraint based on the
>>>> advertized power-of-two overviews exposed from GDAL and no loss of quality.
>>>>
>>>> Best regards,
>>>> Frank
>>>>
>>>>
>>>> On Wed, Sep 4, 2013 at 6:52 AM, Markus Schneider <schneider at occamlabs.de
>>>> <mailto:schneider at occamlabs.de>> wrote:
>>>>
>>>>     Dear list,
>>>>
>>>>     I am new to programming with GDAL (and to the ECW format). Let me say
>>>>     thank you first, because my first experiences have been rather pleasant,
>>>>     even if my setup is relatively involved (thanks everybody for providing
>>>>     good documentation):
>>>>
>>>>     - Ubuntu 12.04 (AMD64)
>>>>     - GDAL 1.10.1 (build from source)
>>>>     - ECW SDK 5.0
>>>>     - GDAL Java bindings
>>>>
>>>>     I successfully created a toy Java class for extracting regions from an
>>>>     ECW file. Speed is impressive.
>>>>
>>>>     My observations/questions:
>>>>
>>>>     - If I understand correctly, ECW files internally do not have such a
>>>>     thing as fixed overviews. However, ECW supports extraction of regions
>>>>     with specified resolution on-the-fly. Is this correct?
>>>>     - GDAL API reports overviews for ECW datasets. Having a first look at
>>>>     the code, it seems to generate overview dimensions by subsequently
>>>>     dividing height and width by two (until a minium side length of 128 has
>>>>     been reached).
>>>>
>>>>     Final question: Is it possible to efficiently retrieve (regions of)
>>>>     overviews at self-defined scales using the GDAL API? Or do I have to use
>>>>     the ECW SDK for that?
>>>>
>>>>     Keep up the good work. Thanks for any pointers.
>>>>
>>>>     Best regards,
>>>>     Markus
>>>>
>>>>     --
>>>>     Markus Schneider
>>>>     CEO
>>>>
>>>>     Occam Labs UG (haftungsbeschränkt)
>>>>     Godesberger Allee 139
>>>>     53175 Bonn, Germany
>>>>
>>>>     +49 228 93798874 <tel:%2B49%20228%2093798874>
>>>>
>>>>     http://www.occamlabs.de
>>>>
>>>>
>>>>     _______________________________________________
>>>>     gdal-dev mailing list
>>>>     gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>>>     http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> ---------------------------------------+--------------------------------------
>>>> I set the clouds in motion - turn up   | Frank Warmerdam,
>>>> warmerdam at pobox.com <mailto:warmerdam at pobox.com>
>>>> light and sound - activate the windows | http://pobox.com/~warmerdam
>>>> and watch the world go round - Rush    | Geospatial Software Developer
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>
>>
>>
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
> 
> 
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 


-- 
Markus Schneider
CEO

Occam Labs UG (haftungsbeschränkt)
Godesberger Allee 139
53175 Bonn, Germany

+49 228 93798874

http://www.occamlabs.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130910/260a11e5/attachment-0001.pgp>


More information about the gdal-dev mailing list