[gdal-dev] JPEG2000 via range request

Martin e11904212 at student.tuwien.ac.at
Fri Aug 26 04:56:42 PDT 2022


Hi,

I want to process JP2 data via vsicurl. Which works so far.
Unfortunately hundreds of requests are sent, even if only the data of 
one tile is required.
I understand that due to the structure of a JP2 file multiple requests 
are necessary. But it looks like GDAL is searching every single tile 
(resulting in ~120 requests).

Is there a way to reduce the number of requests?

I have already tried the JP2ECW-ERDAS driver, same result.

Do I have to configure GDAL in a certain way?

cmd for request:

     #!/bin/bash

     export GDAL_DISABLE_READDIR_ON_OPEN="YES"
     export CPL_VSIL_CURL_ALLOWED_EXTENSIONS="jp2"
     export CPL_CURL_VERBOSE="YES"
     export GDAL_HTTP_MERGE_CONSECUTIVE_RANGES="YES"

     gdal_translate --debug ON -srcwin 0 0 256 256 
/vsicurl/http://localhost:8083/T33UWP_20220515T100031_TCI_10m_J2Lmin.jp2 
./out_subWin.tif

What options do I need to specify when creating the JP2 file to support 
GDAL?

Currently I use the following options:

     #!/bin/bash

     gdal_translate \
         -of JP2OpenJPEG \
         -co QUALITY=100 \
         -co TLM=YES \
         -co PLT=YES \
         -co PROGRESSION=LRCP \
         -co WRITE_METADATA=YES \
         ../test_data/T33UWP_20220515T100031_TCI_10m.tif \
         ./T33UWP_20220515T100031_TCI_10m_J2Lmin.jp2

Some logs:

[gdal degug output](https://pastebin.com/vTf7tjLJ)
[nginx logs](https://pastebin.com/8bWW15Tp)
[gdalinfo](https://pastebin.com/HWSmypEQ)
[opj_dump](https://pastebin.com/rdYbHEnY)
[kdu_jp2info](https://pastebin.com/atVUfeVx)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220826/a34348b4/attachment.htm>


More information about the gdal-dev mailing list