[gdal-dev] netcdf driver does not support VSIFILE

Etienne Tourigny etourigny.dev at gmail.com
Fri Jun 15 10:15:49 PDT 2012


On Fri, Jun 15, 2012 at 12:44 PM, Even Rouault
<even.rouault at mines-paris.org> wrote:
> Selon Etienne Tourigny <etourigny.dev at gmail.com>:
>
>> All VSIFILE interfaces (/vsicurl/ , /vsigzip/ , etc.) do not work with
>> the netcdf driver.
>>
>> As the netcdf driver uses libnetcdf, I'm not sure the driver can be
>> modified to use the "large file API".
>>
>> Can someone comment on this?
>>
>> The GTiff driver support VSI, how is this done given that the driver
>> uses libgeotiff? Does the tifvsi.cpp/ file make this possible, by
>> acting as a proxy?
>
> libtiff has a TIFFClientOpen() interface where you provide pointers to functions
> for various stuff, including I/O functions. And libgeotiff has a similar
> XTIFFClientOpen() that just calls TIFFClientOpen() after doing some libgeotiff
> initialization.
>
>> If so, can a similar thing be done with libnetcdf?
>
> You are probably one of the best placed to answer the question ;-)

I was afraid you'd say that! I am knowledgeable with the netcdf api,
but its inner workings are still somewhat mysterious.

>
> More seriously, you need to look at the libnetcdf API to see if it offers some
> abstraction layer for its I/O, that can be customized, instead of doing directly
> fopen(), fread(), fwrite(), fseek(), fclose() directly all over its code. If
> not, and you want it, you'll need to hack into libnetcdf to avoid those direct
> calls to the standard library.

Quick inspection show non-customizable calls like

	fd = open(path, oflags, 0);
	(void) close(fd);

Netcdf-4 uses hdf5, but that also seems non-flexible:
        #define HDopen(S,F,M)    open(S,F,M)

This means it would probably be quite a challenge, one that should
involve quite a few people (ideally the UNIDATA folks)...

So I'm not sure it's really worth it, unfortunately -  I don't have the time

thanks
Etienne
>
>>
>> thanks,
>> Etienne
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>


More information about the gdal-dev mailing list