[GRASS-SVN] r42907 - grass-addons/vector/v.autokrige
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 27 05:44:41 EDT 2010
Author: neteler
Date: 2010-07-27 09:44:41 +0000 (Tue, 27 Jul 2010)
New Revision: 42907
Modified:
grass-addons/vector/v.autokrige/v.autokrige
Log:
fix encoding mess
Modified: grass-addons/vector/v.autokrige/v.autokrige
===================================================================
--- grass-addons/vector/v.autokrige/v.autokrige 2010-07-27 09:32:14 UTC (rev 42906)
+++ grass-addons/vector/v.autokrige/v.autokrige 2010-07-27 09:44:41 UTC (rev 42907)
@@ -306,40 +306,40 @@
writevarrast <- as.logical(args[13])
variablename <- args[14]
-tryCatch({
- #libraries
- library(spgrass6)
- library(automap)
-
- #retrieve sites in a SpatialPointsDataFrame object
- cat("retrieve sites from GRASS","\n")
+tryCatch({
+ #libraries
+ library(spgrass6)
+ library(automap)
+
+ #retrieve sites in a SpatialPointsDataFrame object
+ cat("retrieve sites from GRASS","\n")
sitesR <- readVECT6(sitesG, ignore.stderr = F)
- #uncomment to check sites
+ #uncomment to check sites
#sitesR
-
- cat("retrieve metadata","\n")
- G <- gmeta6()
- cat("GridTopology creation","\n")
+
+ cat("retrieve metadata","\n")
+ G <- gmeta6()
+ cat("GridTopology creation","\n")
grd <- gmeta2grd()
- #this is necessary to ensure that we have square cells ; the more this number is small, the more the kriged map resolution is high
- slot(grd, "cellsize") <- c(cellsize, cellsize)
+ #this is necessary to ensure that we have square cells ; the more this number is small, the more the kriged map resolution is high
+ slot(grd, "cellsize") <- c(cellsize, cellsize)
- #creation of another grid object: SpatialGridDataFrame
- #this is a matrix whose values receive spatial coordinates associated to interpolated values
- #matrix size must be equal to the number of GridTopology cells
- #we create first a classical data.frame
- data <- data.frame(list(k=rep(1,(floor(G$cols)*floor(G$rows)))))
- cat("SpatialGridDataFrame creation","\n")
- mask_SG <- SpatialGridDataFrame(grd, data=data, CRS(G$proj4))
+ #creation of another grid object: SpatialGridDataFrame
+ #this is a matrix whose values receive spatial coordinates associated to interpolated values
+ #matrix size must be equal to the number of GridTopology cells
+ #we create first a classical data.frame
+ data <- data.frame(list(k=rep(1,(floor(G$cols)*floor(G$rows)))))
+ cat("SpatialGridDataFrame creation","\n")
+ mask_SG <- SpatialGridDataFrame(grd, data=data, CRS(G$proj4))
- #add coordinates system
+ #add coordinates system
attr(sitesR, "proj4string") <-CRS(G$proj4)
cat("ordinary kriging","\n")
#[note : rajouter une option pour gérer le krigeage universel]
kriging_result = autoKrige(as.formula(paste(column,"~",1)), sitesR[column], mask_SG, model = modelslist, fix.values = c(nugget,range,sill), debug.level=-1, verbose=TRUE)
-
- cat("send raster to GRASS","\n")
+
+ cat("send raster to GRASS","\n")
writeRAST6(kriging_result$krige_output,rastername,zcol=1,NODATA=0)
cat("Generated",rastername," "); cat("", sep="\n")
if(writevarrast == T) {
@@ -402,3 +402,4 @@
echo "done"
cleanup
exit 0
+
More information about the grass-commit
mailing list