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

Dutrieux, Loic loic.dutrieux at wur.nl
Thu Nov 20 17:34:04 CET 2014


If you create a header for the file, using hrd(), with e.g. format='ENVI', then you should be able to open it in pretty much any GIS software. You have to point to the .gri file.
That will preserve band names for when you re-import in R, and make the file possible to import in ArcGIS. I'm afraid you won't be able to get the band names outside of R though.

Best regards,
Loïc
________________________________________
From: Wall, Wade A ERDC-RDE-CERL-IL [Wade.A.Wall at usace.army.mil]
Sent: Thursday, November 20, 2014 5:23 PM
To: Dutrieux, Loic; r-sig-geo at r-project.org
Subject: RE: Maintaining band names in multiband raster objects

It is convenient for me, unfortunately it is not convenient for downstream users. They need a format that can be imported in (I hate to say it) ArcGIS. They are having trouble importing the native raster format into ArcGIS and I haven't had any luck either.

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




-----Original Message-----
From: Dutrieux, Loic [mailto:loic.dutrieux at wur.nl]
Sent: Thursday, November 20, 2014 9:33 AM
To: Wall, Wade A ERDC-RDE-CERL-IL; r-sig-geo at r-project.org
Subject: [EXTERNAL] RE: Maintaining band names in multiband raster objects

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