[Raster-commits] r164 - pkg/raster/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 20 10:12:57 CET 2009
Author: rhijmans
Date: 2009-01-20 10:12:57 +0100 (Tue, 20 Jan 2009)
New Revision: 164
Modified:
pkg/raster/R/get.R
pkg/raster/R/writeGDAL.R
Log:
Modified: pkg/raster/R/get.R
===================================================================
--- pkg/raster/R/get.R 2009-01-20 02:55:24 UTC (rev 163)
+++ pkg/raster/R/get.R 2009-01-20 09:12:57 UTC (rev 164)
@@ -32,7 +32,7 @@
rowFromCell <- function(object, cell) {
if (.isSPgrid(object)) { object <- asRasterLayer(object, FALSE) }
- cell <- as.integer(round(cell))
+ cell <- round(cell)
cell[cell < 1 | cell > ncell(object)] <- NA
rownr <- as.integer(trunc((cell-1)/ncol(object)) + 1)
return(rownr)
@@ -41,7 +41,7 @@
colFromCell <- function(object, cell) {
if (.isSPgrid(object)) { object <- asRasterLayer(object, FALSE) }
- cell <- as.integer(round(cell))
+ cell <- round(cell)
cell[cell < 1 | cell > ncell(object)] <- NA
rownr <- as.integer(trunc((cell-1)/ncol(object)) + 1)
colnr <- as.integer(cell - ((rownr-1) * ncol(object)))
Modified: pkg/raster/R/writeGDAL.R
===================================================================
--- pkg/raster/R/writeGDAL.R 2009-01-20 02:55:24 UTC (rev 163)
+++ pkg/raster/R/writeGDAL.R 2009-01-20 09:12:57 UTC (rev 164)
@@ -123,6 +123,9 @@
.writeGDALrow <- function(raster, gdalfiletype, overwrite, ForceIntOutput, mvFlag, options ) {
rownr <- rowFromCell(raster, dataIndices(raster)[1])
+ if (rownr %in% c(1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 20000, 30000, 40000, 50000, 100000)) {
+ print( paste("writing row", rownr, "at:", format(Sys.time(), "%H:%M:%S")))
+ }
if ( rownr == 1) {
transient <- .getGDALtransient(raster, gdalfiletype, overwrite, ForceIntOutput, mvFlag, options)
attr(raster, "transient") <- transient
More information about the Raster-commits
mailing list