[gdal-dev] GDAL, vsis3 and vsisubfile

Mike Pfaffenberger mike.pfaffenberger at gmail.com
Mon Jul 24 07:55:16 PDT 2017


I turned on some debug options that shed some light on to what's going on.
It appears that the NITF driver must internally open a JPEG 2000 Driver on
a virtual subfile. In my case, that virtual subfile starts at offset 4038
and continues to the end of the file, offset 901949970.

While this is a nice way of providing a JPEG2000 decompression routine to
the NITF driver, when accessing a remote dataset, it causes the entire file
to be downloaded even when reading a small window.

I used gdal_translate locally on my NITF file and turned it into a JP2
file, then I uploaded this file to S3 and ran my gdal_translate -srcwin 000
000 1000 1000 /vsis3/mybucket/jp2file.JP2 local_file.tiff and it ran
instantly. Is there a way to completely bypass using the NITF driver and
simply open the NITF file with the JP2 driver wrapped up with vsis3?

Thank you very much for your time. Also thank you for writing the vsicurl
and vsis3 code -- it's been very useful!

On Mon, Jul 24, 2017 at 10:41 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> On dimanche 23 juillet 2017 23:09:05 CEST you wrote:
>
> > Hi Even,
>
> >
>
> > I posted in the gdal-dev mailing list about reading sub-windows out of
> NITF
>
> > files in S3. I turned on some debug options that shed some light on to
>
> > what's going on. It appears that the NITF driver must internally open a
>
> > JPEG 2000 Driver on a virtual subfile. In my case, that virtual subfile
>
> > starts at offset 4038 and continues to the end of the file, offset
>
> > 901949970.
>
> >
>
> > While this is a nice way of providing a JPEG2000 decompression routine to
>
> > the NITF driver, when accessing a remote dataset, it causes the entire
> file
>
> > to be downloaded even when reading a small window.
>
> >
>
> > I used gdal_translate locally on my NITF file and turned it into a JP2
>
> > file, then I uploaded this file to S3 and ran my gdal_translate -srcwin
> 000
>
> > 000 1000 1000 /vsis3/mybucket/jp2file.JP2 local_file.tiff and it ran
>
> > instantly. Is there a way to completely bypass using the NITF driver and
>
> > simply open the NITF file with the JP2 driver wrapped up with vsis3?
>
> >
>
> > Thank you very much for your time. Also thank you for writing the vsicurl
>
> > and vsis3 code -- it's been very useful!
>
>
>
> Do you mind reposting your above findings to the gdal-dev thread so we can
> continue the exchange there ?
>
>
>
> 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/20170724/7147e892/attachment.html>


More information about the gdal-dev mailing list