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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 22 09:01:36 CET 2009


Author: rhijmans
Date: 2009-01-22 09:01:35 +0100 (Thu, 22 Jan 2009)
New Revision: 172

Modified:
   pkg/raster/R/get.R
   pkg/raster/R/raster.create.R
   pkg/raster/man/get.Rd
Log:


Modified: pkg/raster/R/get.R
===================================================================
--- pkg/raster/R/get.R	2009-01-22 05:48:24 UTC (rev 171)
+++ pkg/raster/R/get.R	2009-01-22 08:01:35 UTC (rev 172)
@@ -106,7 +106,7 @@
 }	
 	
 
-xyFromCell <- function(object, cell, asSpatialPoints=FALSE, projstring="") {
+xyFromCell <- function(object, cell, asSpatialPoints=FALSE) {
 	if (.isSPgrid(object)) { object <- asRasterLayer(object, FALSE) }
 	cell <- round(cell)
 	xy <- matrix(data = NA, ncol=2, nrow=length(cell))
@@ -116,7 +116,7 @@
 	xy[,2] <- yFromRow(object, rownr) 		
 	colnames(xy) <- c("x", "y")
 	if (asSpatialPoints) {
-		xy <- SpatialPoints(xy, newCRS(projstring))
+		xy <- SpatialPoints(xy, projection(object, asText=FALSE))
 	}
 	return(xy)
 }  

Modified: pkg/raster/R/raster.create.R
===================================================================
--- pkg/raster/R/raster.create.R	2009-01-22 05:48:24 UTC (rev 171)
+++ pkg/raster/R/raster.create.R	2009-01-22 08:01:35 UTC (rev 172)
@@ -146,7 +146,7 @@
 	raster at file@nodatavalue <- nodataval
 	
 	inidatatype <- trim(inidatatype)
-	if (substr(inidatatype, 1, 3) == "ForceIntOutput") { datatp="integer"
+	if (substr(inidatatype, 1, 3) == "INT") { datatp="integer"
 	} else { datatp="numeric" }
 	datasz <- as.integer(substr(inidatatype, 4, 4))
 	raster <- setDatatype(raster, datatype=datatp, datasize=datasz)

Modified: pkg/raster/man/get.Rd
===================================================================
--- pkg/raster/man/get.Rd	2009-01-22 05:48:24 UTC (rev 171)
+++ pkg/raster/man/get.Rd	2009-01-22 08:01:35 UTC (rev 172)
@@ -31,7 +31,7 @@
 cellFromXY(object, xy)
 xFromCol(object, colnr)
 yFromRow(object, rownr)
-xyFromCell(object, cell, asSpatialPoints, projstring)
+xyFromCell(object, cell, asSpatialPoints=FALSE)
 cxyFromBbox(object, bbox)
 validCells(object, cell) 
 validCols(object, colnr) 
@@ -48,7 +48,6 @@
   \item{rownr}{row number(s)}
   \item{bbox}{A boundinBox object (or an object that can be coerced to a BoundingBox object)}
   \item{asSpatialPoints}{return a SpatialPoints object (sp package) instead of a matrix}
-  \item{projstring}{PROJ4 format character string to set projection for SpatialPoints object}
 }
   
 \details{



More information about the Raster-commits mailing list