Opened 13 years ago
Closed 10 years ago
#2379 closed enhancement (fixed)
GDAL with NetCDF4 - Adjustment to recognize netCDF4
Reported by: | maartenplieger | Owned by: | etourigny |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | netcdf, netcdf4 |
Cc: | Kyle Shannon, maartenplieger |
Description
Adjustment to the netCDF driver to recognize the netCDF4 files. In 'netCDFdataset.cpp' at line 1308: I added " && !((nc_inq_libvers()[0]=='4')&&EQUALN((const char *)poOpenInfo->pabyHeader+1,"HDF",3))) ". This line checks for the netCDF4 library ('4') and for a 'HDF' header. This makes sure that in case of the netCDF4 library, HDF files are also picked up by this driver. (NetCDF4 uses the HDF5 file format, see: http://www.unidata.ucar.edu/software/netcdf/netcdf-4/)
Attachments (5)
Change History (12)
comment:1 Changed 13 years ago by
Milestone: | → 1.5.2 |
---|
comment:2 Changed 13 years ago by
Milestone: | 1.5.2 |
---|---|
Version: | unspecified → 1.5.0 |
comment:3 Changed 11 years ago by
Keywords: | netcdf netcdf4 added; NetCDF4 removed |
---|
comment:4 Changed 10 years ago by
Cc: | Kyle Shannon added |
---|
Changed 10 years ago by
Attachment: | patch-ncfiletype.txt added |
---|
Changed 10 years ago by
Changed 10 years ago by
Changed 10 years ago by
Changed 10 years ago by
Attachment: | h5ex_d_alloc.h5 added |
---|
comment:5 Changed 10 years ago by
Version: | 1.5.0 → svn-trunk |
---|
Attached a proposed fix for this issue and also #3890 (for nc2 64-bit files). Also a few files for testing.
The proposal is to add a nFiletype variable , #defines for the various NetCDF file types and a new Identify() function. If need be I can also provide a simpler patch which only does the file checking and doesn't mess with the class definition.
If HDF5 is installed in GDAL but NetCDF has not been compiled with NetCDF-4 (and HDF5), the HDF5 GDAL driver is used instead. Also tested a non-netcdf HDF5 file, and the NetCDF driver does not interfere.
comment:6 Changed 10 years ago by
Owner: | changed from warmerdam to etourigny |
---|---|
Status: | new → assigned |
Fixed in trunk.
r23081 adds support for nc2 and nc4 in netcdfdataset.cpp r23080 adds autotests and 3 test files to see if nc2 and nc4 are supported, and also makes sure that hdf5 files (that are not netcdf) are opened by the hdf5 driver.
If someone that has netcdf4 installed can test the fix, I will close the bug.
comment:7 Changed 10 years ago by
Cc: | maartenplieger added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Please refer to ticket #3890 for fixes and information related to this bug.
Closing this bug as it works for me. Unfortunately, I cannot test in Windows.
Adjustment to the netCDF driver to recognize the netCDF4 files. In 'netCDFdataset.cpp' at line 1308: I added:
This line checks for the netCDF4 library ('4') and for a 'HDF' header. This makes sure that in case of the netCDF4 library, HDF files are also picked up by this driver. (NetCDF4 uses the HDF5 file format, see: http://www.unidata.ucar.edu/software/netcdf/netcdf-4/)