[Gdal-dev] how is yllcorner determined and why

Janeen janeen at splash.princeton.edu
Wed Nov 22 11:03:33 EST 2006


Hello All,

I've just tried the gdal_translate utility on a NetCDF file, converting 
it to the AAIGrid format.  I'm new to the world of GIS and NetCDF also.  
So in using the utility, I want to be sure that I understand how all the 
data from  the  .nc file  makes it over to the ascii file.

I can't quite figure out how the yllcorner value being reported is 
calculated, and why it is transformed the way it is.  I've looked at the 
code and gotten as far as this line in aaigriddataset.cpp:

   adfGeoTransform[3]- nYSize * adfGeoTransform[1]

I can't quite get what the variable adfGeoTransform[3] represents from 
the original .nc file.  The part of the equation:
    nYSize * adfGeoTransform[1]  

I understand where those values  come from in my sample file (i.e. 180 
*  0.994444444444  = 179 ).  Given that yllcorner is being reported as 
-269, that means that the value for adfGeoTransform[3] would be -90.   
But what does that value represent in my original netCDF file given the 
info below?

If anyone can give me a description of what is going on here, I would 
appreciate it.  Below is header  and gdalinfo.

Janeen


Here is the gdal header info from my converted .nc file:

   cols        360
   nrows        180
   xllcorner    0.500000000000
   yllcorner    -269.000000000000
   dx           0.997222222222
   dy           0.994444444444
   NODATA_value -10000000000

Here is (relevant) gdalinfo from my .nc file
   Driver: netCDF/Network Common Data Format
   Size is 360, 180
   Coordinate System is `'
   Origin = (0.500000,-89.500000)
   Pixel Size = (0.99722222,0.99444444)
   Corner Coordinates:
   Upper Left  (   0.5000000, -89.5000000)
   Lower Left  (   0.5000000,  89.5000000)
   Upper Right (     359.500,     -89.500)
   Lower Right (     359.500,      89.500)
   Center      ( 180.0000000,   0.0000000)






More information about the Gdal-dev mailing list