[gdal-dev] Cannot read NetCDF subdatasets
Etienne Tourigny
etourigny.dev at gmail.com
Tue Jun 19 10:48:40 PDT 2012
On Tue, Jun 19, 2012 at 2:25 PM, Paolo Corti <pcorti at gmail.com> wrote:
> Hi Etienne
>
>> I would guess your netcdf and gdal installation do not have netcdf-4 support.
>> And probably a 'gdalinfo <file>' shows the hdf5 driver picks it up, right?
>
> That was!
> I was missing out the --enable-netcdf-4 option: after recompiling
> netcdf with that option option and then recompiling GDAL everything
> works fine :)
> By the way, hdf5 is still picked when opening the whole dataset, but
> netcdf is correctly picked when opening the subdataset: is it the
> desired behavior?
>
no... unless your system uses the hdf5 driver before the netcdf driver.
If the netcdf driver detects a hdf5 file that ends with nc, nc2, nc4
or cdf (the common extensions) then it opens it, else it passes it to
the hdf5 driver.
There is no other way of identifying hdf5 files that are not "netcdf-4" files.
There is a test in the autotest suite that tests that the netcdf
driver picks up netcdf-4 files but not other hdf5 files. If you do
have the autotests installed, try to run the gdrivers/netcdf.py test.
Can you send an example file to me?
> Thanks so much for your invaluable support, Etienne! ;)
> p
you are welcome!
Etienne
>
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
More information about the gdal-dev
mailing list