[gdal-dev] Issue with GDAL - JP2KAK driver

Even Rouault even.rouault at spatialys.com
Sun Jun 28 03:20:05 PDT 2020


Boris,

> JP2KAK: DirectRasterIO() for 0,0,8192,8192 -> 512x512 (no intermediate)

This traces is probably a bit confusing, but it means that it reads from the overview you 
specified.

>     CPLSetConfigOption("CPL_VSIL_CURL_CHUNK_SIZE", "1000000");

This is probably the reason for the behaviour you observe. JPEG2000 files aren't necessarily 
all optimized for efficient overview retrieval. You should check the "progression order" of 
that file. If it is not RPCL or RLCP, the bits for overviews are scattered through the file, and so 
with a large chunk size you'll read a lot of the file. If you reduced it, the total amount of bytes 
read would be smaller, but you'd get a lot more GET requests.

But... with RPCL or RLCP progression order, reading a window at full resolution could become 
less efficient than with PCRL

I don't think you can get with JPEG2000 something equivalent to TIFF + overviews, because 
in TIFF + overviews you have redundancy of information (each resolution includes 
information already found in lower resolution), whereas JPEG2000 is optimized to avoid that 
redundancy, which also means that information is scattered through the file.

> The higher the overview, the bigger the request from S3, as if GDAL reads
> the best resolution and resamples the results.

Yes, that's "expected" given the above.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200628/85308ee4/attachment.html>


More information about the gdal-dev mailing list