|Version 26 (modified by etourigny, 19 months ago)|
This page is for information regarding improvements to the GDAL NetCDF driver.
For information on the current NetCDF driver, please consult:
UNIDATA NetCDF Conventions
UNIDATA recommends the use of the CF Conventions (NetCDF Climate and Forecast (CF) Metadata Conventions) where applicable.
It is intended that this driver fully support the CF-1.5 Conventions for import and export and COARDS for import. Provisions should be taken for back-wards compatibility with different CF-1.x versions.
- NetCDF Conventions at UNIDATA
- CF-1.5 - NetCDF Climate and Forecast (CF) Metadata Conventions
- COARDS conventions (1995 standard that CF Conventions extends and generalizes)
- CF compliance checker (python script) - don't use to validate grid structure
Issues with the current implementation
- NetCDF created by GDAL not CF-1.0 compliant for geographical grids (issue #2129) - fixed in trunk
- netcdf driver does not read and write CF-1.0 coordinate system properly for projected CRS (issue #2893)
- support for read and write of projected coordinate values
- export std_parallel variables into a single standard_parallel netcdf attribute
- add proper datum import and export support
- issues with specific projections:
- add CF compliance checker to the autotests (issue #4233) - fixed
- support "coordinates" attribute for projections which are not supported by GDAL/PROJ.4 (i.e rotated pole) (issue #4251)
GDAL and NetCDF support metadata in different ways, which should be harmonised.
Issues with the current implementation
- The import process does not use the Conventions attribute and does not consider different possible Conventions (COARDS, CF-1.0, CF-1.5, etc.)
- netcdf history global attribute should be updated. Does GDAL offer a history mechanism?
- CF-version of file read could be kept in an internal variable, as well as CF-version for file creation
Issues that have been resolved (in trunk)
- Duplication in Metadata when translating from NetCDF to NetCDF (issue #4204)
- metadata from a NetCDF variable should be stored inside the GDAL Band metadata, instead of a global metadata item (issue #4211)
- NetCDF variable name is lost when imported into GDAL (issue #4211)
- Floating-point metadata in netcdf file is converted to GDAL metadata as string without sufficient precision (issue #4211)
- GDAL version saved in GDAL global attribute
CF supports Datum information but does not specify how datum ids (such as those found in EPSG codes) should be stored in the netcdf file
- Which datum should be set when there is no datum information at all in a netcdf file? WGS84 or none?
- How to export datum information that is present in a GDAL file, in a way that it can be restored later?
- Import should correctly set appropriate CRS/datum information (e.g. WGS84) from the information in the netcdf file, when sufficient information is available.
The driver should handle properly a time and Z-axis in a way that they they are not lost when importing and exporting.
- Disabled PAM support, as it created incompatibilities and metadata duplication. Will re-enable once things are settled - #4244 and #4245
- Support Create() method so that gdalwarp can be used on a netcdf file - #4221
Fix access to different netcdf file types: nc (classic), nc2 (64-bit) and nc4 (NetCDF4 with HDF5 support) - #3890 and #2379
- Add option for file type (nc,nc2,nc4) at export (#3166) -> fixed in trunk, but needs Win32 support and autotests (nc4/nc2, import conflict w/HDF)
- Support compressed netcdf data (szip, zip)
- fix the y-axis for import and export (issues #4251 and #4284)
- support packed data (with add_offset and scale_factor) transparently (see bug #3797)
Compatibility with other software
The driver should be compatible for import and/or export (with proper visualisation) with at least the following software:
- ncdump from UNIDATA netcdf
- CF compliance checker
- GrADS - Grid Analysis and Display System
- CDO - Climate Data Operator
- NCO - netCDF Operators
- TDS - THREDDS Data Server (i.e. ensure its WCS and WMS capabilities work)
- ncWMS - ncWMS is the package that TDS uses for WMS presentation of NetCDF files, also includes the GODIVA web viewer for same.
- others to come...
A place should be set up to store NetCDF sample files, provided they are free under the terms of http://download.osgeo.org/gdal/data/COPYING .
Large files will be available at http://download.osgeo.org/gdal/data/netcdf .
Having small (typically < or ~ 10 KB ) sample files is also good so they can be directly included in SVN under the autotest/gdrivers/data directory and thus easily used by regression tests.
- Contributors are welcome and could be identified here in 3 categories: Ideas/reporting, testing, and/or development.
- Discussions can take place here or the mailing list with the title "NetCDF Improvements"
- Tickets can be used to track the implementation of specific items and bugfixes.
- Backward compatibility issues, in particular with respect to files produced by older GDAL versions, might require voting, as in http://trac.osgeo.org/gdal/wiki/rfc1_pmc details
Proposed changes that affect interface or backward compatibility
(Note: this linked page may be turned into an RFC if needed)
I (etiennesky) have created this wiki entry after a discussion in the gdal-dev mailing list (Subject: discussion on improvements to the NetCDF driver and CF-1 convention). Even made a number of suggestions which I have followed (I also shamelessly copied some of his wording).
I encourage interested parties in participating in this discussion here and in the mailing list. In particular, it would be useful to collect information on contributors and obtain test files with issues and the expected outcome. Simple files can also be included in order to test for regression issues in the future.
Regards, etiennesky - Aug. 28
- NetCDF Driver Improvements
- band selection in NETCDF driver
- netcdf: add metadata record for original array dimension when reading from multidimensional files
- NetCDF Global EASE-Grid 8-day Blended SSM/I and MODIS Snow Cover flipped east/west?
- netcdf driver does not read and write CF-1.0 coordinate system properly for projected CRS
- PAM stores duplicate metadata even if the format and driver support
- OGR does not support PROJ.4 +proj=ob_tran , rotated_pole is not supported by the netcdf driver
- gdalwarp on large netcdf datasets sets data from first input dataset to <nodata> and generates error if -dstnodata option is used with netcdf-4 file
- netcdf files with longitude between 180 and 360 degrees are incorrectly projected
- netcdf driver does not support irregular grids / GDAL GEOLOCATION arrays
- NetCDF driver writes incorrect GeoTranform in case of WRITE_BOTTOMUP=YES
- PATCH: DODS driver can now read 3-D datasets, metadata, projection, remote NetCDF files