Opened 16 years ago
Closed 13 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 by , 16 years ago
Milestone: | → 1.5.2 |
---|
comment:2 by , 16 years ago
Milestone: | 1.5.2 |
---|---|
Version: | unspecified → 1.5.0 |
comment:3 by , 14 years ago
Keywords: | netcdf netcdf4 added; NetCDF4 removed |
---|
comment:4 by , 13 years ago
Cc: | added |
---|
by , 13 years ago
Attachment: | patch-ncfiletype.txt added |
---|
by , 13 years ago
by , 13 years ago
by , 13 years ago
by , 13 years ago
Attachment: | h5ex_d_alloc.h5 added |
---|
comment:5 by , 13 years ago
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 by , 13 years ago
Owner: | changed from | to
---|---|
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 by , 13 years ago
Cc: | 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/)