[GRASS-SVN] r38161 - grass-addons/vector/v.krige

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 2 09:01:42 EDT 2009


Author: aghisla
Date: 2009-07-02 09:01:41 -0400 (Thu, 02 Jul 2009)
New Revision: 38161

Modified:
   grass-addons/vector/v.krige/v.krige.py
Log:
restored automap result export


Modified: grass-addons/vector/v.krige/v.krige.py
===================================================================
--- grass-addons/vector/v.krige/v.krige.py	2009-07-02 11:17:36 UTC (rev 38160)
+++ grass-addons/vector/v.krige/v.krige.py	2009-07-02 13:01:41 UTC (rev 38161)
@@ -194,8 +194,7 @@
         self.parent.log.write('Kriging performed.')
         
         #5. Format output
-        #@IDEA: set a generic f(x) for this too? seems like, because zcol= is only the first peculiar arg for gstat.
-        robjects.r.writeRAST6(KrigingResult, vname = self.OutputMapName.GetValue(), zcol='var1.pred',
+        SelectedPanel.ExportMap(map = KrigingResult, col='var1.pred', name = self.OutputMapName.GetValue(),
                               overwrite = self.OverwriteCheckBox.GetValue())
         self.parent.log.write('Yippee! Succeeded! Ready for another run.')
         
@@ -257,16 +256,19 @@
         self.Sizer = wx.BoxSizer(wx.VERTICAL)
         self.Sizer.Add(self.VariogramSizer, proportion=0, flag=wx.EXPAND | wx.ALL, border=3)
         self.Sizer.Add(KrigingRadioBox,  proportion=0, flag=wx.EXPAND | wx.ALL, border=3)
+    #
+    #def FitVariogram(self, *args, **kwargs):
+    #    pass
+    #
+    #def DoKriging(self, *args, **kwargs):
+    #    pass
+    #
+    #def HideOptions(self, event):
+    #    pass
     
-    def FitVariogram(self, *args, **kwargs):
-        pass
+    def ExportMap(self, map, col, name, overwrite):
+        robjects.r.writeRAST6(map, vname = name, zcol = col, overwrite = overwrite)
     
-    def DoKriging(self, *args, **kwargs):
-        pass
-    
-    def HideOptions(self, event):
-        pass
-    
 class RBookautomapPanel(RBookPanel):
     """ Subclass of RBookPanel, with specific automap options and kriging functions. """
     def __init__(self, parent, *args, **kwargs):
@@ -286,7 +288,8 @@
         
     def DoKriging(self, formula, data, grid, **kwargs):
         KrigingResult = robjects.r.autoKrige(formula, data, grid)
-        return KrigingResult.r['krige_output']
+        print robjects.r.str(KrigingResult.r['krige_output'][0])
+        return KrigingResult.r['krige_output'][0]
     
     def HideOptions(self, event):
         for n in ["Sill", "Nugget", "Range"]:
@@ -319,6 +322,7 @@
         
     def DoKriging(self, formula, data, grid,  model):
         KrigingResult = robjects.r.krige(formula, data, grid, model)
+        print KrigingResult.rclass
         return KrigingResult
     
 class RBookgeoRPanel(RBookPanel):



More information about the grass-commit mailing list