[gdal-dev] NetCDF config option for west > east?

Even Rouault even.rouault at spatialys.com
Sat Nov 24 08:07:56 PST 2018


On samedi 24 novembre 2018 16:27:33 CET Markus Metz wrote:
> I have a NetCDF file with west > east, gdalinfo reports
> Corner Coordinates:
> Upper Left  (     335.257,      70.000)
> Lower Left  (     335.257,      30.000)
> Upper Right (  44.7424710,  69.9999970)
> Lower Right (  44.7424710,  29.9999954)
> Center      (     190.000,      50.000)
> 
> west =  335.257 > east = 44.7424710
> 
> The reason is that west has been wrapped such that it is in the range [0,
> 360], and GDAL thinks that columns need to be read from right to left
> instead of left to right.
> 
> The fix is to convert west with west -= 360, then assign corrected extents
> with gdal_translate -a_ullr
> 
> There is a config option GDAL_NETCDF_BOTTOMUP. Could something similar be
> implemented for west > east, something like GDAL_NETCDF_LEFTISLEFT? Or is
> it a corrupted file and manual correction is the only option?

Couldn't find anything related mentionned in the CF convention, but that 
doesn't make that file illegal. I guess that could be auto-corrected by 
detecting there's a discontinuity in the values of the longitude variable.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list