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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 30 07:17:34 CET 2009


Author: rhijmans
Date: 2009-01-30 07:17:34 +0100 (Fri, 30 Jan 2009)
New Revision: 220

Modified:
   pkg/raster/R/makeProjString.R
   pkg/raster/man/project.Rd
Log:


Modified: pkg/raster/R/makeProjString.R
===================================================================
--- pkg/raster/R/makeProjString.R	2009-01-30 05:58:45 UTC (rev 219)
+++ pkg/raster/R/makeProjString.R	2009-01-30 06:17:34 UTC (rev 220)
@@ -6,7 +6,7 @@
 
 
 
-makeProj <- function(projection='longlat', ..., ellipsoid="", datum="WGS84", asText=TRUE) {
+makeProj <- function(projection='longlat', ..., ellipsoid="", datum="", asText=TRUE) {
 	prj <- projInfo("proj")
 	ell <- projInfo("ellps")
 	dat <- projInfo("datum")
@@ -32,8 +32,7 @@
 			pstr <- paste(pstr, " +ellps=", ellipsoid, sep="")
 #			ellipname <- ell[which(ell[,1]==ellipsoid), 2]
 		}
-	}
-	if (datum != "") {
+	} else if (datum != "") {
 		if (!(datum %in% dat[,1])) { 
 			stop("unknown datum. See projInfo('datum')") 
 		} else {
@@ -41,11 +40,9 @@
 #			datumname <- as.vector(dat[which(dat[,1]==datum), 2])
 		}
 	}
-	
 	cat("Projection: ", projname[1], "\n")
 	
 	crs <- newCRS(pstr)
-
 		
 	if (asText) { 
 		return(trim(crs at projargs))
@@ -54,6 +51,6 @@
 	}
 }
 
- newprj2 <- makeProj("lcc", "lat_1=48", "lat_2=33", "lon_0=-100", asText=T)
+# newprj2 <- makeProj("lcc", "lat_1=48", "lat_2=33", "lon_0=-100", asText=T)
 
 

Modified: pkg/raster/man/project.Rd
===================================================================
--- pkg/raster/man/project.Rd	2009-01-30 05:58:45 UTC (rev 219)
+++ pkg/raster/man/project.Rd	2009-01-30 06:17:34 UTC (rev 220)
@@ -10,7 +10,7 @@
 \usage{
 projectRaster(from, to, method="nngb", overwrite=FALSE)
 projectBbox(object, projstring)
-makeProj(projection='longlat', ..., ellipsoid="", datum="WGS84", asText=TRUE) 
+makeProj(projection='longlat', ..., ellipsoid="", datum="", asText=TRUE) 
 }
 
 \arguments{
@@ -24,13 +24,23 @@
   \item{...}{parameters for the projection}  
   \item{ellipsoid}{}
   \item{datum}{}  
-  \item{asText}{logical. If \{code}{FALSE}, an object of class 'CRS' will be returned.}  
+  \item{asText}{logical. If \code{FALSE}, an object of class 'CRS' will be returned.}  
 }
 
 \details{
- first create projected bbox (in BasicRaster object). Then project. 
+ First create projected bbox (in BasicRaster object). Then project. 
+ 
  makeProj is a helper function to create a valid PROJ.4 string or CRS object. 
- See projInfo('proj'), projInfo('ellps'), and projInfo('datum') for valud choices
+ 
+ See projInfo('proj'), projInfo('ellps'), and projInfo('datum') for valud choices. Specify either an ellipsoid, or a datum (datum is ignored if ellipsoid != "")
+ 
+ Many projections take additioanl paramters to the projection name (e.g. lon_0, x_0, y_0). Supply these in the '...'. 
+ 
+ You can consult this webpage: \url{http://www.remotesensing.org/geotiff/proj_list/} to find the parameter options and names for your projection.
+ 
+ 
+ Projection is performed using the PROJ.4 library accesed through the rgdal package 
+ 
 }
 
 \value{



More information about the Raster-commits mailing list