[Gdal-dev] Incorrect adfGeoTransform on a NETCDF subdataset

Joaquim Luis jluis at ualg.pt
Tue Apr 24 16:53:48 EDT 2007


Hi again,

Now the problem is with adfGeoTransform.
adfGeoTransform[3] and adfGeoTransform[5] have the sign swapped on a 
NETCDF dataset.

Without checking how GDALInfoReportCorner() works I think that the 
problem is illustrated
with the following example

Cheers

Joaquim Luis

Use GMT to create two example files
grdmath -R-10/15/-9/16 -I1 = t1.grd           ------ netCDF file
grdmath -R-10/15/-9/16 -I1 = t2.grd=cf      ------ old GMT format file

gdalinfo t2.grd
Driver: GMT/GMT NetCDF Grid Format
Size is 26, 26
Coordinate System is `'
Origin = (-10.500000000000000,16.500000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Corner Coordinates:
Upper Left  ( -10.5000000,  16.5000000)
Lower Left  ( -10.5000000,  -9.5000000)              ---------------> 
CORRECT
Upper Right (  15.5000000,  16.5000000)
Lower Right (  15.5000000,  -9.5000000)
Center      (   2.5000000,   3.5000000)
Band 1 Block=26x1 Type=Float32, ColorInterp=Undefined


gdalinfo NETCDF:"t1.grd":z
Driver: netCDF/Network Common Data Format
Size is 26, 26
Coordinate System is `'
Origin = (-10.500000000000000,-9.500000000000000)
Pixel Size = (1.000000000000000,1.000000000000000)
Metadata:
  NC_GLOBAL#Conventions=COARDS
  NC_GLOBAL#history=grdmath -R-10/15/-9/16 -I1 = t1.grd
  NC_GLOBAL#node_offset=0
  z#long_name=z
  z#_FillValue=1.#QNAN0e+000
  z#actual_range=0.000000e+0000.000000e+000
  x#long_name=x
  x#actual_range=-1015
  y#long_name=y
  y#actual_range=-916
Corner Coordinates:
Upper Left  ( -10.5000000,  -9.5000000)
Lower Left  ( -10.5000000,  16.5000000)
Upper Right (  15.5000000,  -9.5000000)               
------------------> WRONG
Lower Right (  15.5000000,  16.5000000)
Center      (   2.5000000,   3.5000000)
Band 1 Block=26x1 Type=Float32, ColorInterp=Undefined
  NoData Value=1.#QNAN
  Metadata:
    NETCDF_VARNAME=z



More information about the Gdal-dev mailing list