[gdal-dev] Reading remote jp2k files

Poughon Victor Victor.Poughon at cnes.fr
Fri Sep 7 06:10:20 PDT 2018


Hi Even,

> 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.

I'm a jp2000 noob but do you know if windowed reads of remote jp2 data could be optimized in some way? I am curious if we could see a "cloud optimized jpeg2000" someday?




Victor Poughon

> -----Message d'origine-----
> De : gdal-dev <gdal-dev-bounces at lists.osgeo.org> De la part de Even Rouault
> Envoyé : mercredi 25 juillet 2018 18:00
> À : gdal-dev at lists.osgeo.org
> Objet : Re: [gdal-dev] Reading remote jp2k files
> 
> Matt,
> 
> >
> > I'm having trouble reading JP2K files remotely. I originally ran into
> > this problem when trying to use remote Sentinel-2 files as input to
> > the GDAL Warp API in C++. It works when I use a local version of the file.
> >
> > I'm not sure if this is supported behavior, I thought it was, but to
> > test I tried gdal_translate on a remote file, and one with the local file.
> >
> > $ gdal_translate
> > https://sentinel-s2-l1c.s3.amazonaws.com/tiles/32/T/QR/2018/1/21/0/B04
> > .jp2
> > sentinel-test-remote.tif -f GTiff
> > $ gdal_translate B03.jp2 sentinel-test-local.tif -f GTiff
> >
> > The local file works fine, but when using the remote file
> > gdal_translate just crashes with no error message.
> 
> A process crash ? Can you get a stack trace / valgrind output ?
> 
> I tried, and it failed in a regular way, since when you use http:// the HTTP driver triggers. This
> driver downloads the whole file in memory before passing it to the real driver, and it deleted the
> temp file, whereas the JP2OpenJPEG driver needs to be able to re-open it. Just fixed that issue
> 
> >
> > I'm using GDAL 2.3.1 with openjpeg 2.3, I'm using a docker image
> > developmentseed/geolambda:1.0.0 and you can see the Dockerfile here:
> >
> > https://github.com/developmentseed/geolambda/blob/master/Dockerfile
> >
> > 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.
> 
> Even
> 
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list