[R-sig-Geo] Maintaining band names in multiband raster objects

Dutrieux, Loic loic.dutrieux at wur.nl
Thu Nov 20 16:33:02 CET 2014


Hi Wade,

If that's convenient for you, try to store your data in the native format of the raster package (.grd). It has the advantage of preserving layer names.

Best regards,
Loïc
________________________________________
From: r-sig-geo-bounces at r-project.org [r-sig-geo-bounces at r-project.org] on behalf of Wall, Wade A ERDC-RDE-CERL-IL [Wade.A.Wall at usace.army.mil]
Sent: Thursday, November 20, 2014 4:21 PM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Maintaining band names in multiband raster objects

Hi all,

I am trying to keep band names from imported netcdf files intact when I export them using the writeRaster() function from the Raster package, but they are removed and replaced with "Band1, band2, band3, etc."

The .nc files I am importing are located at http://gdo-dcp.ucllnl.org/downscaled_cmip_projections/dcpInterface.html#Welcome

When I import the .nc files, names(raster object) yields band names such as x2006.01.15 (January 15 2006). These names are interpretable and I would like to preserve them.

Is there a way to specify band names for exported raster objects in R? I have seen posts suggesting it is not possible, but if they can be read, then they should be able to be written.

Wade A. Wall
US Army ERDC-CERL
P.O. Box 9005
Champaign, IL  61826-9005
1-217-373-4420
Wade.A.Wall at usace.army.mil<mailto:Wade.A.Wall at usace.army.mil>




        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list