disable PAM in netcdf driver
|Reported by:||etourigny||Owned by:||etourigny|
The netcdf driver creates duplicate geotransform, projection, metadata and novalue information in auxiliary PAM file.
This is unnecessary as these values are already available in the netcdf file itself.
Moreover, it has the unpleasant side effect of loading geotransform and projection information that may not be valid, if it was modified by an external program or through other mecanisms.
For illustration purposes, loss of sync between the PAM data and the netcdf file can be reproduced with the attached file (which is a lat/lon file with no datum). Geo-referencing is not copied over to the new netcdf file (due to another bug, which will be fixed), but is kept in the PAM file:
$ gdalinfo trmm-cp.nc ... Coordinate System is `' Origin = (-80.000000000000000,-10.000000000000000) Pixel Size = (0.250000000000000,-0.250000000000000) Metadata: ... $ gdal_translate -of netcdf trmm.nc trmm-cp.nc $ gdalinfo trmm-cp.nc ... Coordinate System is `' Origin = (-80.000000000000000,-10.000000000000000) Pixel Size = (0.250000000000000,-0.250000000000000) Metadata: ... $ cat trmm-cp.nc.aux.xml <PAMDataset> <GeoTransform> -8.0000000000000000e+01, 2.5000000000000000e-01, 0.0000000000000000e+00, -1.0000000000000000e+01, 0.0000000000000000e+00, -2.5000000000000000e-01</GeoTransform> ... $ rm trmm-cp.nc.aux.xml ; gdalinfo trmm-cp.nc Coordinate System is `' Metadata:
PAM support for netcdf was implemented in r7553 .
Support for fetching geotransform, projection, metadata and nodata from PAM was silently introduced in r13698 and r13699 for bug#2196, which is unrelated to PAM.
This has been done quite some time ago, but can Frank recall why this was done?
I propose the following:
1) Remove the support for fetching geotransform, projection, metadata and nodata from PAM (reverting the PAM-related changes in r13698)
2) Prevent these variables from being written to PAM, as they are not necessary 3) optional - do not write PAM when creating a new netcdf
1) is easy but how can I go about with 2) ?
I honestly don't see any regression issues that these changes can cause.
Change History (6)
comment:2 by , 12 years ago
|Summary:||netcdf driver should not use PAM to fetch and save fundamental information → disable PAM in netcdf driver|