Changes between Initial Version and Version 3 of Ticket #1505
- Timestamp:
- Mar 26, 2007, 12:19:25 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1505 – Description
initial v3 1 {{{2 1 This issue was initially posted on the gdal-dev mailing list using GDAL 1.3.2 (see http://lists.maptools.org/pipermail/gdal-dev/2006-October/010393.html for original message and netCDF file attachment). I am experiencing the same behaviour in GDAL 1.4.0 under Cygwin WinXPSP2. 3 2 4 3 My netCDF file was generated using NCO (ncra), and now I need to convert the NetCDF file into a different format for GIS programs: 4 {{{ 5 5 $ gdal_translate -of AAIGrid -sds test.nc test.asc 6 6 $ mv test.asc1 test.asc 7 }}} 7 8 No errors were generated during the conversion. 8 9 9 10 The header of the AAIGrid output is: 11 {{{ 10 12 ncols 86 11 13 nrows 225 … … 15 17 dy 99.555555555556 16 18 NODATA_value -9999 17 19 }}} 18 20 However, these headers should read: 21 {{{ 19 22 ncols 86 20 23 nrows 225 … … 23 26 cellsize 100 24 27 NODATA_value -9999 28 }}} 25 29 26 30 The dx/dy in the output of the file was incorrectly calculated as: 31 {{{ 27 32 dx=cellsize*(ncol-1)/ncol 28 33 dy=cellsize*(nrow-1)/nrow 34 }}} 29 35 30 36 theses formulas are of course nonsense, but are apparently how they were calculated. This is also why dx != dy (because ncols != nrows), and why they are not correct, since they are multiplied by the ratio of base0/base1 representations of their dimension lengths. … … 33 39 34 40 (As a caution, I have also seen some netCDF files which order their latitudes from North to South, which is also in reverse order; I'm not sure if this is tested, and corrected in GDAL, but I would highly advise it for netCDF files). 35 }}}