[gdal-dev] netcdf to geotiff and aaigrid

Joaquim Luis jluis at ualg.pt
Tue Jan 22 17:42:22 EST 2008


> Thanks for the suggestion.  However, assuming (which I know is bad) 
> that what your code from SVN is equal to the SVN code I can get from 
> the web: gdal-svn-trunk-2008.01.22.tar.gz, I still don't get the 
> proper header info, as I was still getting 28.0 instead of the 
> expected 38.0 for yll.  However, from this post from awhile back 
> (http://lists.osgeo.org/pipermail/gdal-dev/2006-December/011202.html), 
> it seems like someone else was having the same issues I was (wrong yll 
> and inverted netCDF file), and made some changes to 
> /frmts/aaigrid/aaigriddataset.cpp, and after I did the same, I'm now 
> seeing the proper yll and the image is no longer inverted.  Nice. :)

Jeff,

That's a bit strange. I just did a fresh svn, recompiled and I still get 
the correct yll=38.0
Regarding your solution of changing aaigriddataset.cpp, be careful for 
it might bite you back in the future.
An alternative is to use also GMT. You can convert your .nc files to the 
GMT old netcdf format. For example with
grdreformat your_nc_file.nc tmp.grd=cf
and than use the GDAL's GMT driver, which doesn't suffer from up-down 
problem, to do the conversion to GeoTiff.

Joaquim


More information about the gdal-dev mailing list