GDAL Virtual File Systems in SNAP

Hello!

I understand there’s a GDAL driver in S2tbx.
Is the support for GDAL Virtual File Systems planned?

Cheers

@mengdahl this could be a very nice feature for a SNAP evolution.

Happy to share the benefits of the approach!

Yes please elaborate what this is for…!

Hi @mengdahl

GDAL explains the VSI as:

GDAL can access files located on “standard” file systems, ie in the / hierarchy on unix-like systems or in c:, d:, etc… drives on Windows. But most GDAL raster and vector drivers use a GDAL specific abstraction to access files. This makes it possible to access less standard types of files, such as in-memory files, compressed files (.zip, .gz, .tar, .tar.gz archives), encrypted files, files stored on network (either publicly accessible, or in private buckets of commercial cloud storage services), etc…

This comes from http://www.gdal.org/gdal_virtual_file_systems.html

Along with this you should take the time to read about the Cloud Optimized Geotiff (http://www.cogeo.org/) and the GDAL wiki page https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF

To make it simple you can access portions of files (radiometric and/or spatial subset) by exploiting the byte serving technology of web servers without downloading the full product.

Several tools like the Orfeo Toolbox (also available in Monteverdi) support this.

Here’s an example with gdal:

gdalwarp -tr 20 20 -te 14.6934 37.451 15.2934 38.051 -te_srs EPSG:4326 /vsicurl/http://sentinel-s2-l1c.s3.amazonaws.com/tiles/33/S/VB/2017/10/15/0/B04.jp2 B04.tif

This resamples a Sentinel-2 band 4 to 20 meters resolution in the bounding box [14.6934 37.451 15.2934 38.051]

SNAP could implement an operator to do similar operations and the use the remaining operators.

Something like:

gpt ReadVSI -h

With the graph XML:

  <graph id="someGraphId">
    <version>1.0</version>
    <node id="someNodeId">
      <operator>ReadVSI</operator>
      <sources/>
      <parameters>
        <vsiUrl>URL</vsiUrl>
        <boundingBox>string</string>
        <projWin>string</projWin>
        <projWinSRS>string</projWinSRS>
      </parameters>
    </node>
  </graph>

Looking forward to see this great feature in SNAP

Feel free to come back at me with questions or clarifications

Hi Fabrice,
exactly such things are on the agenda for the further SNAP development and will come within the next year.

2 Likes

Hi Marco!

A giant +1 on this enhancement.

Cheers

1 Like

Hello @marpet and @fabricebrito,

Do you know if SNAP support for GDAL virtual file systems was implemented?