[Raster-commits] r303 - in pkg/raster: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 28 10:26:28 CET 2009


Author: rhijmans
Date: 2009-02-28 10:26:26 +0100 (Sat, 28 Feb 2009)
New Revision: 303

Added:
   pkg/raster/man/copyRasterFile.Rd
Modified:
   pkg/raster/DESCRIPTION
   pkg/raster/R/set.R
   pkg/raster/R/show.R
Log:


Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION	2009-02-27 02:41:41 UTC (rev 302)
+++ pkg/raster/DESCRIPTION	2009-02-28 09:26:26 UTC (rev 303)
@@ -1,8 +1,8 @@
 Package: raster
 Type: Package
 Title: Raster data handling for geographic data analysis and modeling
-Version: 0.8.8-7
-Date: 25-Feb-2009
+Version: 0.8.8-8
+Date: 28-Feb-2009
 Depends: methods, sp, rgdal (>= 0.5-33), R (>= 2.8.0)
 Author: Robert J. Hijmans & Jacob van Etten
 Maintainer: Robert J. Hijmans <r.hijmans at gmail.com> 

Modified: pkg/raster/R/set.R
===================================================================
--- pkg/raster/R/set.R	2009-02-27 02:41:41 UTC (rev 302)
+++ pkg/raster/R/set.R	2009-02-28 09:26:26 UTC (rev 303)
@@ -97,7 +97,7 @@
 	return(object)
 }
 
-nudgeCoords <- function(bb){
+.nudgeCoords <- function(bb){
 	bb <- getBbox(bb)
 	bb at xmin <- floor(bb at xmin)
 	bb at ymin <- floor(bb at ymin)

Modified: pkg/raster/R/show.R
===================================================================
--- pkg/raster/R/show.R	2009-02-27 02:41:41 UTC (rev 302)
+++ pkg/raster/R/show.R	2009-02-28 09:26:26 UTC (rev 303)
@@ -1,7 +1,7 @@
 # Author: Robert J. Hijmans, r.hijmans at gmail.com
 # International Rice Research Institute
 # Date :  June 2008
-# Version 0,8
+# Version 0.8
 # Licence GPL v3
 
 
@@ -37,14 +37,14 @@
 	function(object) {
 		cat('class       :' , class(object), '\n')
 		cat('filename    :' , filename(object), '\n')
-		if (nbands(object) > 1) {
-			cat('band        :' , band(object), '\n')
-		}	
+		if (nbands(object) > 1) { cat('band        :' , band(object), '\n')	}	
 		cat('nrow        :' , nrow(object), '\n')
 		cat('ncol        :' , ncol(object), '\n')
 		cat('ncells      :' , ncell(object), '\n')
-		cat('data type   :' , object at file@datanotation, '\n')
-		cat('data content:' ,  dataContent(object), '\n')
+#		cat('data type   :' , object at file@datanotation, '\n')
+#		if (dataContent(object) == 'nodata') { cat('vals in mem : none', '\n')
+#		} else { cat('vals in mem :', dataContent(object) , '\n') }
+						
 		if (object at data@haveminmax) {
 			cat('min value   :' , minValue(object), '\n')
 			cat('max value   :' , maxValue(object), '\n')
@@ -70,7 +70,7 @@
 
 
 setMethod ('show' , 'RasterStack',
-	function ( object ){
+	function ( object ) {
 		cat ('class       :' , class ( object ) , '\n')
 		cat ('filename    :' , filename(object), '\n')
 		cat ('nlayers     :' , nlayers(object), '\n')
@@ -78,7 +78,8 @@
 		cat ('ncol        :' , ncol(object), '\n')
 		cat ('ncells      :' , ncell(object), '\n')
 		cat ('projection  :' , projection(object, TRUE), '\n')
-		cat ('data content:' , dataContent(object), '\n')
+#		if (dataContent(object) == 'nodata') { cat('vals in mem : none', '\n')
+#		} else { cat('vals in mem :', dataContent(object) , '\n') }
 		cat ('xmin        :' , xmin(object), '\n')
 		cat ('xmax        :' , xmax(object), '\n')
 		cat ('ymin        :' , ymin(object), '\n')

Added: pkg/raster/man/copyRasterFile.Rd
===================================================================
--- pkg/raster/man/copyRasterFile.Rd	                        (rev 0)
+++ pkg/raster/man/copyRasterFile.Rd	2009-02-28 09:26:26 UTC (rev 303)
@@ -0,0 +1,42 @@
+\name{moveRasterFile}
+
+\alias{moveRasterFile}
+\alias{copyRasterFile}
+
+\title{move or copy a raster file}
+
+\description{
+  Move or copy a raster file to a different location (filename). 
+}
+
+\usage{
+  moveRasterFile(raster, filename, overwrite=FALSE) 
+  copyRasterFile(raster, filename, overwrite=FALSE) 
+}
+
+\arguments{
+  \item{raster}{RasterLayer object that is associated with a file on disk}
+  \item{filename}{output filename}  
+  \item{overwrite}{Logical. If \code{TRUE} existing files are overwritten}
+}
+
+\details{
+}
+
+\value{
+a RasterLayer
+}
+
+\author{Robert J. Hijmans}
+
+\seealso{ \code{\link[raster]{saveAs}} }  
+
+\examples{ 
+rs <- rasterFromFile(system.file("external/test.ag", package="sp"))
+rs <- saveAs(rs, 'test.grd', filetype='raster', overwrite=TRUE)
+rsc <- copyRasterFile(rs, 'test2.grd', overwrite=TRUE)
+rsm <- moveRasterFile(rs, 'test3.grd', overwrite=TRUE)
+ 
+}
+
+\keyword{ spatial }



More information about the Raster-commits mailing list