[gdal-dev] Cannot choose netCDF driver instead of HDF5 for nc files

Even Rouault even.rouault at spatialys.com
Thu Oct 12 05:22:54 PDT 2023


Works for me with GDAL 3.6, 3.7 and master on Ubuntu 20.04

$ gdalinfo 
/vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2B/2022/07/03/S2B_MSIL1C_20220703T112119_N0400_R037_T32VLN_20220703T121203.nc
Driver: netCDF/Network Common Data Format
[...]

/vsicurl/ functionality for the netCDF driver requires using a specific 
system call of Linux. See 
https://gdal.org/drivers/raster/netcdf.html#vsi-virtual-file-system-api-support

Le 12/10/2023 à 14:01, Stefan Blumentrath via gdal-dev a écrit :
> Hi,
> I am wondering if the behavior of the NetCDF driver changed in recent 
> GDAL version(s)?
> I do have the netCDF driver installed and also HDF5, which has been 
> shaddowing the netCDF driver. So I used to do the following:
> export GDAL_SKIP=HDF5
> gdalinfo 
> /vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2B/2022/07/03/S2B_MSIL1C_20220703T112119_N0400_R037_T32VLN_20220703T121203.nc
> But this gives me now:
> ERROR 4: 
> `/vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2B/2022/07/03/S2B_MSIL1C_20220703T112119_N0400_R037_T32VLN_20220703T121203.nc' 
> not recognized as a supported file format.
> (or in Python syntax:
> from osgeo import gdal
> gdal.GetDriverByName("HDF5").Deregister()
> ds = 
> gdal.Open("/vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2B/2022/07/03/S2B_MSIL1C_20220703T112119_N0400_R037_T32VLN_20220703T121203.nc")
> )
> If I do not deregister the HDF5 driver the dataset is opened, but with 
> the HDF5 driver, and I want to use the netCDF driver for those 
> CF-convention files...
> I am on Ubuntu 22.04, GDAL 3.6.4, released 2023/04/17...
> Any idea how that can be solved? Is it a bug or a feature?
> Thanks for helping in advance!
> Cheers
> Stefan
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20231012/76b4a014/attachment.htm>


More information about the gdal-dev mailing list