[gdal-dev] vsicurl and HDF5

Even Rouault even.rouault at spatialys.com
Thu Jan 5 09:03:31 PST 2023


Paolo,

Le 05/01/2023 à 17:56, Paolo Corti a écrit :
> Hi all
>
> Do you know if I can read HDF5 files with vsicurl?
> I made a few tests, but I am getting this error, so I was wondering it
> it is even possible:

yes this is possible. If you get the error message you mention, it means 
that the HDF5 driver is not used, but rather the netCDF one, since the 
Linux userfaultfd system call is the trick used by the netCDF driver to 
allow /vsicurl/ usage. Perhaps you are running from a container (like 
Docker) that doesn't enable that system call by default.  With Docker, 
you might need to start your container with --privileged=true

If you have the HDF5 driver available, it is better integrated with the 
VSI virtual file systems and that shoud work on any operating systems, 
whereas /vsicurl/ with the netCDF driver can only work with Linux

Demo:

$ gdalinfo 
/vsicurl/http://download.osgeo.org/gdal/data/hdf5/vlstr_metadata.h5
Driver: HDF5Image/HDF5 Dataset
Files: /vsicurl/http://download.osgeo.org/gdal/data/hdf5/vlstr_metadata.h5
Size is 3024, 1673
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1673.0)
Upper Right ( 3024.0,    0.0)
Lower Right ( 3024.0, 1673.0)
Center      ( 1512.0,  836.5)
Band 1 Block=3024x1 Type=Byte, ColorInterp=Undefined
   Metadata:
     TEST_BANDNAMES=SAA
     TEST_CODING=0.6666666667 0.0000000000 TRUE
     TEST_FLAGS=255=noValue
     TEST_MAPPING=Geographic Lat/Lon 0.5000000000 0.5000000000 
27.3154761905 -5.0833333333 0.0029761905 0.0029761905 WGS84 Degrees
     TEST_NOVALUE=255
     TEST_RANGE=0 255 0 255

Even

-- 

http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list