[gdal-dev] Reading remote jp2k files

Jan Vaillant jvail at gmx.de
Wed Jul 25 23:02:19 PDT 2018


Hi,

On 07/25/2018 06:00 PM, Even Rouault wrote:
>> Is this supported behavior, should I be able to read these files remotely,
>> and do windowed reads on them?
> 
> For windowed reads, you need to prefix with /vsicurl/, but I don't guarantee
> the efficiency of this with JPEG2000 in general, and with JP2OpenJPEG in
> particular.

Regarding "efficiency" I'd like to add two observations from a little 
investigation (not really in-depth) I did recently to compare /vsicurl/ 
with a tiny, experimental JS lib (fetch & decode single jp2 tiles in 
pure JS):

- If I try to fetch a window that is completely within one tile it 
*seems* vsicurl is iterating through all tiles and does not stop after 
reaching & fetching the "requested" tile.

- Instead of starting from the first tile it could make a guess and 
start at that offset and search backwards and forward till it finds the 
requested tile index. Although a good "guess" of an offset is difficult 
given that tile size might vary greatly.

I think this could probably make fetching parts slightly more efficient 
(in terms of no. of requests & data transfer). Certainly it would be 
much easier if tile offsets could be included in a jp2 header.

Jan



More information about the gdal-dev mailing list