[Raster-commits] r296 - pkg/raster/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 24 06:56:02 CET 2009


Author: rhijmans
Date: 2009-02-24 06:56:02 +0100 (Tue, 24 Feb 2009)
New Revision: 296

Modified:
   pkg/raster/R/copyRaster.R
   pkg/raster/R/init.R
Log:


Modified: pkg/raster/R/copyRaster.R
===================================================================
--- pkg/raster/R/copyRaster.R	2009-02-24 05:42:19 UTC (rev 295)
+++ pkg/raster/R/copyRaster.R	2009-02-24 05:56:02 UTC (rev 296)
@@ -6,7 +6,7 @@
 
 
 moveRasterFile <- function(raster, filename, overwrite=FALSE) {
-	r <- copyRaster(raster, filename, overwrite)
+	r <- copyRasterFile(raster, filename, overwrite)
 	f <- trim(filename(raster))
 	fileext <- toupper(fileExtension(f)) 
 	if (fileext == ".GRD") {

Modified: pkg/raster/R/init.R
===================================================================
--- pkg/raster/R/init.R	2009-02-24 05:42:19 UTC (rev 295)
+++ pkg/raster/R/init.R	2009-02-24 05:56:02 UTC (rev 296)
@@ -6,14 +6,14 @@
 
 
 init <- function(raster, fun=runif, filename="", overwrite=FALSE, datatype = 'FLT4S', filetype='raster', track=-1) {
-	filename <- trim(filename)
+
 	outraster <- setRaster(raster, filename)
-	outraster <- setDatatype(raster, datatype)
-
+	outraster <- setDatatype(outraster, datatype)
+	
 	if ( dataContent(raster) == 'all' | dataSource(raster) == 'ram' ) {
 		n <- ncell(raster)
 		outraster <- setValues(outraster, fun(n)) 
-		if (filename != "") {	
+		if (filename(outraster) != "") {	
 			outraster <- writeRaster(outraster, overwrite=overwrite) 
 		}
 		



More information about the Raster-commits mailing list