126 | | The new implementation saves the GeoTransform array only for a geographic CRS, in the specific case that lon/lat values are not written to the file. The corner coordinates are never saved as they are redundant. |
127 | | |
| 126 | The new implementation does not save the GeoTransform array, with the exception of when the GeoTransform cannot be retrieved from the netcdf file (i.e. only for a geographic CRS, in the specific case that lon/lat values are not written ). This has the effect that in some cases, the computed pixel width and height (GT(1) and GT(5)) differs by a very small amount from the original values in the GDAL raster file, due to various floating-point operations and half-pixel shifts. |
| 127 | |
| 128 | For example, |
| 129 | {{{ |
| 130 | Given a landsat file (tmp/melb-small_AEA.nc) generated by the autotest netcdf_cdf_4: |
| 131 | |
| 132 | src:(1232736.8666076646, 30.080459243369152, 0.0, -4118493.9582119514, 0.0, -30.080459243369152) |
| 133 | dst:(1232736.8666076646, 30.080459243369834, 0.0, -4118493.9582119514, 0.0, -30.080459243366494) |
| 134 | |
| 135 | The difference in width/height is less than 10E^-11 (10 pm), while the corners are identical. |
| 136 | |
| 137 | However, when translating the original landsat file (melb-small.tif) in UTM, the pixel width/height of 30m is preserved exactly. |
| 138 | }}} |
| 139 | |
| 140 | We feel that this difference is marginal, however should a strong argument be presented, we could save the GeoTransform as before and compare with the values stored in the CF dimensions variable for conflict. |
| 141 | The corner coordinates are never saved as they are redundant. When importing a CF file, if GeoTransform cannot be computed from dimension variables, GeoTransform and corner coordinates are consulted if available. |
| 142 | |