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

Markus Metz markus.metz.giswork at gmail.com
Sat Nov 24 08:39:31 PST 2018


On Sat, Nov 24, 2018 at 5:07 PM Even Rouault <even.rouault at spatialys.com>
wrote:
>
> 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.

This particular NetCDF file, PM10 analysis from CAMS
http://www.regional.atmosphere.copernicus.eu/, does not have a longitude
variable, also no subdatasets. Resolution should be 0.1 degrees, but GDAL
reports
Pixel Size = (-0.415021467959250,-0.100000003824258)
because west > east

full gdalinfo output without band info:

Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files:
W_fr-meteofrance,MODEL,ENSEMBLE+ANALYSIS+SURFACE+PM10+-24H-1H_C_LFPW_20181120000000.nc
Size is 700, 400
Coordinate System is `'
Origin = (335.257498526948382,69.999996950154312)
Pixel Size = (-0.415021467959250,-0.100000003824258)
Metadata:
  latitude#long_name=latitude
  latitude#units=degrees_north
  level#long_name=level
  level#units=m
  longitude#long_name=longitude
  longitude#units=degrees_east
  NC_GLOBAL#ANALYSIS=Europe, 20181119+[0H_23H]
  NC_GLOBAL#comment=Tools used: CDO V1.6.1rc6 and NCO V4.3.7
  NC_GLOBAL#history=Model ENSEMBLE ANALYSIS
  NC_GLOBAL#institution=Data produced by Meteo France
  NC_GLOBAL#nco_openmp_thread_number=1
  NC_GLOBAL#project=MACC-RAQ (http://macc-raq.gmes-atmosphere.eu)
  NC_GLOBAL#source=Data from ENSEMBLE model
  NC_GLOBAL#summary=ENSEMBLE model hourly ANALYSIS of PM10 concentration at
the Surface from 20181119+[0H_23H] on Europe
  NC_GLOBAL#title=PM10 Air Pollutant ANALYSIS at the Surface
  NETCDF_DIM_EXTRA={time,level}
  NETCDF_DIM_level_DEF={1,5}
  NETCDF_DIM_level_VALUES=0
  NETCDF_DIM_time_DEF={24,5}

NETCDF_DIM_time_VALUES={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
  pm10_conc#species=PM10 Aerosol
  pm10_conc#standard_name=mass_concentration_of_pm10_ambient_aerosol_in_air
  pm10_conc#units=µg/m3
  pm10_conc#value=hourly values
  time#long_name=ANALYSIS time from 20181119
  time#units=hours
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)
Band 1 Block=700x1 Type=Float32, ColorInterp=Undefined
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181124/621399dd/attachment-0001.html>


More information about the gdal-dev mailing list