[gdal-dev] netcd from WRF

Vincent Mora vincent.mora at oslandia.com
Tue Oct 17 02:58:18 PDT 2017


Hi,

I'm trying to visualize **weather forecast data from WRF** in QGIS.
Ultimately I'd like to add support for viewing/navigating datasets with
multiple dimensions (Z and time with like sliders to navigate through
bands).

gdal recognizes the bands just fine, although the netcdf produced by
**WRF does not follow netcdf conventions**
(https://www.ncl.ucar.edu/Applications/wrfnetcdf.shtml)

The data I have is Lambert93. I was able to add a grid_mapping with
GeoTransform and spatial_ref using ncap and ncatted (see below for how
the file is modified to have the crs regognized by gdal)

The issue I have now is that although the **first band displays
correctly for a given variable, the folowing bands (corresponding to
different times) are wrapped** by qgis (which means that the
geotransform is not recognized properly).

I think that I could use a vrt, maybe with a python filter, to work
around the issue, but I'd rather fix the driver if the described
behavior is considered buggy.

Questions:

- is the multiple band model a smart approach for time-varying data ?

- shall I try and improve the netcdf driver:

    - to fix the spatial_ref/geotransform not recognized in bands>1 (if
fix needed, because I'm not yet sure)

    - to recognize WRF files ? (or is it too specific/no-standard to
worth it)


Thanks,

V.













# here is what I do to the WRF .nc file to have it referenced properly

ncap -s 'lambert93=-9999' test_wrfout.nc test_wrfout_1.nc

ncatted \
    -a spatial_ref,lambert93,c,c,'PROJCS["RGF93 /
Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS
1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],AUTHORITY["EPSG","2154"],AXIS["X",EAST],AXIS["Y",NORTH]]'
\
    -a GeoTransform,lambert93,c,c,"69815, 9000, 0, 5751408, 0, 9000" \
    -a grid_mapping,,c,c,'lambert93' \
    test_wrfout_1.nc test_wrfout_2.nc

# see also
https://gis.stackexchange.com/questions/218441/how-do-i-display-netcdf-data-with-correct-crs,








More information about the gdal-dev mailing list