[Gdal-dev] Re: NetCDF.. the world turned upside-down

Rich Signell rsignell at usgs.gov
Thu Aug 24 16:40:33 EDT 2006


GDAL-gurus,

I just ran into the upside-down NetCDF issue myself- on a perfectly 
valid CF-compliant file, OpenEV (FWTOOLS 1.0.5) displays it upside down.

For GMT users, this is particularly annoying:  if they are using the old 
non CF-compliant NetCDF grid format, OpenEV will display their grids 
correctly, while if they use the new CF-compliant NetCDF grid form, 
OpenEV will display them upside down.

I think the GDAL driver should be made more flexible so it reads the 
lat/lon data from the coordinate variables and determines which way is 
"up".  The CF convention does not specify positive up or positive down 
-- it just associates the values found in the coordinate variables with 
the dependent variable and clients are expected to do this.  Clients 
like "ncview" and IDV display these data correctly.

An example CF-compliant file that displays correctly in NCVIEW and IDV, 
but is upside down in OpenEV is at:

http://stellwagen.er.usgs.gov/rps/share/vs_new.nc

-Rich

-- 
Richard P. Signell
U.S. Geological Survey       Phone: (508) 457-2229
384 Woods Hole Road          Fax:   (508) 457-2310
Woods Hole, MA  02543-1598


Frank Warmerdam wrote:
> Emilio Mayorga wrote:
> 
>> "Reversed" y-axis datasets are quite common in netcdf (Ferret, for
>> example, pretty much expects that convention -- or at least it did a
>> couple of years ago...). It's not required, but it's probably the
>> dominant convention. I think it boils down to the common use of matrix
>> math in geophysics; the y-axis is seen as positive-up. Unlike the
>> GIS/imagery/"raster" world, where the vertical dimension is
>> interpreted as increasing from the top down.
>>
>> Having gdal_translate and other gdal utilities interpret flipped
>> netcdf y-axis automatically (or providing an optional argument) would
>> be very useful.
> 
> 
> Emilio,
> 
> The normal (and in my opinion proper) process for "upside down" datasets
> is for GDAL to associate a geotransform with the dataset that indicates
> the orientation.  However, I am not adverse to having the netCDF driver
> take care of flipping the data internally if Denis would like to address
> that.  I believe I did do this in the DODS driver since it was otherwise
> very hard to exploit the data in most GDAL based applications.
> 
> Best regards,




More information about the Gdal-dev mailing list