[gdal-dev] Slow speed in remote reading

Alexander Verbitsky habibutsu at gmail.com
Mon Nov 2 06:58:32 PST 2020


Hi All, I am trying to implement remote reading small blocks of images, but
find slow performance.

For example i am trying to read 100x100 block from `sentinel-2` image, with
using following code:

filename = (
    '/vsigs/gcp-public-data-sentinel-2/tiles/31/U/FS/'
    'S2A_MSIL1C_20201024T104121_N0209_R008_T31UFS_20201024T125115.SAFE/'

'GRANULE/L1C_T31UFS_A027890_20201024T104121/IMG_DATA/T31UFS_20201024T104121_B08.jp2'
)
ds = gdal.OpenEx(filename, gdal.OF_RASTER)
band = ds.GetRasterBand(1)
img = band.ReadAsArray(1000, 1000, 100, 100)

In result I am getting more low performance in comparison if I just
download the whole image in memory and then read the necessary block. AS I
understand it happens due to a lot of small requests (is about 100)  that
are made during reading a small part of the image. Is it a fundamental
feature of JP2OpenJPEG and this format not suitable for doing things like
that? Should I take another format like GeoTiff and store my own data in
it? Thank, for your reply.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201102/c4282a6e/attachment.html>


More information about the gdal-dev mailing list