[GRASS-user] netCDF band names

Ken Mankoff mankoff at gmail.com
Mon May 8 06:42:00 PDT 2017


Hi List,

Is there any way to tell GRASS or GDAL to include the variable names in the netcDF file?

I'm writing a raster group to a netCDF file like this:

i.group -l grp
group <catchment> references the following raster maps
-------------
<foo>  <bar>  <baz>
-------------

r.out.gdal input=grp output=grp.nc format=netCDF

Unfortunately, ncdump shows that the group variable names (foo, bar, baz) are not written, and instead everything is just "Band 1" and "Band 2".

	int Band1(y, x) ;
		Band1:long_name = "GDAL Band Number 1" ;
		Band1:_FillValue = -2147483647 ;
		Band1:grid_mapping = "polar_stereographic" ;
	int Band2(y, x) ;
		Band2:long_name = "GDAL Band Number 2" ;
		Band2:_FillValue = -2147483648 ;
	int Band3(y, x) ;
		Band3:long_name = "GDAL Band Number 3" ;
		Band3:_FillValue = -2147483648 ;


This sort-of defeats the purpose of netCDF which should be self-documenting.

  -k.


More information about the grass-user mailing list