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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 10 11:14:40 CET 2009


Author: rhijmans
Date: 2009-02-10 11:14:39 +0100 (Tue, 10 Feb 2009)
New Revision: 267

Modified:
   pkg/raster/R/Merge.R
   pkg/raster/R/crop.R
Log:


Modified: pkg/raster/R/Merge.R
===================================================================
--- pkg/raster/R/Merge.R	2009-02-10 02:18:50 UTC (rev 266)
+++ pkg/raster/R/Merge.R	2009-02-10 10:14:39 UTC (rev 267)
@@ -7,7 +7,7 @@
 # Licence GPL v3
 
 
-.outerBox <- function(objects) {
+bbUnion <- function(objects) {
 	if (length(objects) == 1) {
 		return(getBbox(objects))
 	}
@@ -22,7 +22,7 @@
 	return(bb)
 }
 
-.innerBox <- function(objects) {
+bbIntersect <- function(objects) {
 	if (length(objects) == 1) {
 		return(getBbox(objects))
 	}
@@ -62,7 +62,7 @@
 	
 			
 	compare(rasters, bb=FALSE, rowcol=FALSE, orig=TRUE, res=TRUE, tolerance=tolerance)
-	bb <- .outerBox(rasters)
+	bb <- bbUnion(rasters)
 	outraster <- setRaster(rasters[[1]], filename)
 #	bndbox <- newBbox(bb[1,1], bb[1,2], bb[2,1], bb[2,2])
 	outraster <- setBbox(outraster, bb, keepres=TRUE, snap=FALSE)

Modified: pkg/raster/R/crop.R
===================================================================
--- pkg/raster/R/crop.R	2009-02-10 02:18:50 UTC (rev 266)
+++ pkg/raster/R/crop.R	2009-02-10 10:14:39 UTC (rev 267)
@@ -15,7 +15,7 @@
 
 crop <- function(raster, bndbox, filename="", overwrite=FALSE) {
 # we could also allow the raster to expand but for now let's not and first make a separate expand function
-	bb <- .innerBox(c(raster, bndbox))
+	bb <- bbIntersect(c(raster, bndbox))
 	outraster <- setRaster(raster, filename)
 	outraster <- setBbox(outraster, bb, keepres=T)
 	



More information about the Raster-commits mailing list