[gdal-dev] netcdf to geotiff and aaigrid

Frank Warmerdam warmerdam at pobox.com
Mon Jan 21 20:59:18 EST 2008


Jeff Van Dorn wrote:
> Hello,
> 
> I'm hoping someone can set me straight in how to go about converting a 
> bunch of netCDF files I have into both GTiff and AAIGrid formats, as my 
> initial attempts have failed.  I'm using gdal version "GDAL 1.6.0dev, 
> FWTools 2.0.4, released 2007/12/21".
...
> I do seem to be able to create a mostly valid AAIGrid file by simply 
> doing:  gdal_translate -of AAIGrid, BUT it appears upside-down when 
> putting into something that can read that format, even though the header 
> info seems MOSTLY correct (I'd think yll should really be 38.0000 (min 
> of latitudes in netCDF file - 1/2 grid size, (or 38.0625 - 0.0625)):
> 
> ncols        110
> nrows        80
> xllcorner    -80.750000000000
> yllcorner    28.000000000000
> cellsize     0.125000000000
> 
> But, overall the image appears to be correct, other than inverted in the 
> y direction, which I'm not really sure how to correct.

Jeff,

I tried translating this file with my linux build of GDAL and the output
AAIGRID header looks like:

ncols        110
nrows        80
xllcorner    -80.750000000000
yllcorner    38.000000000000
cellsize     0.125000000000
NODATA_value   -999

I'm not at all sure why you get a yllcorner of 28 when I get 38.  I
displayed the file directly, and the output aaigrid file and both seemed
"right side up" and otherwise normal.

> When I try to convert to the GTiff, from either the AAIGrid or netCDF 
> format, all I get is a black rectangle as an image. 

I suspect this has more to do with the software you are displaying
the GeoTIFF file with than the actual data.  Many software packages
don't do particularly savvy autoscaling of floating point image data.

Have you tried displaying it in OpenEV?

BTW, were you using the linux or win32 version of FWTools.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list