[Raster-commits] r248 - in pkg/raster: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Feb 6 03:24:45 CET 2009
Author: rhijmans
Date: 2009-02-06 03:24:45 +0100 (Fri, 06 Feb 2009)
New Revision: 248
Modified:
pkg/raster/DESCRIPTION
pkg/raster/R/click.R
pkg/raster/R/polygonToRaster.R
Log:
Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION 2009-02-06 01:32:46 UTC (rev 247)
+++ pkg/raster/DESCRIPTION 2009-02-06 02:24:45 UTC (rev 248)
@@ -1,8 +1,8 @@
Package: raster
Type: Package
Title: Raster data handling for geographic data analysis and modeling
-Version: 0.8.7-9
-Date: 3-Feb-2009
+Version: 0.8.8-0
+Date: 6-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/click.R
===================================================================
--- pkg/raster/R/click.R 2009-02-06 01:32:46 UTC (rev 247)
+++ pkg/raster/R/click.R 2009-02-06 02:24:45 UTC (rev 248)
@@ -34,7 +34,11 @@
}
} else {
cell <- cellFromXY(object, xyCoords)
- value <- values(object)[cell]
+ if (class(object) == 'RasterStack') {
+ value <- values(object)[cell,]
+ } else {
+ value <- values(object)[cell]
+ }
}
if (xy) {
return(cbind(xyCoords, value))
Modified: pkg/raster/R/polygonToRaster.R
===================================================================
--- pkg/raster/R/polygonToRaster.R 2009-02-06 01:32:46 UTC (rev 247)
+++ pkg/raster/R/polygonToRaster.R 2009-02-06 02:24:45 UTC (rev 248)
@@ -133,6 +133,12 @@
l <- (k * 2) - 1
x1 <- x[l]
x2 <- x[l+1]
+ if (is.na(x2)) {
+ txt <- paste('something funny at row:', r, 'polygon:',j)
+ print(txt)
+ warning(txt)
+ x2 <- x1
+ }
if (x1 > rxmx) { next }
if (x2 < rxmn) { next }
# adjust to skip first cell if the center is not covered by this polygon
More information about the Raster-commits
mailing list