[GRASS-SVN] r54651 - grass-addons/grass7/raster/r.agent/libagent

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 15 15:02:51 PST 2013


Author: mic
Date: 2013-01-15 15:02:51 -0800 (Tue, 15 Jan 2013)
New Revision: 54651

Modified:
   grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
add a layer from an existing map

Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py	2013-01-15 22:56:36 UTC (rev 54650)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py	2013-01-15 23:02:51 UTC (rev 54651)
@@ -10,6 +10,7 @@
 """
 
 import grass.script as grass
+from grass.script import array as garray
 
 class GrassLand(playground.Playground):
     """A GrassLand is a Playground and the interface to GRASS."""
@@ -53,7 +54,10 @@
         @param string name of a GRASS map layer
         @param boolean optional, whether to overwrite values if key exists
         """
-        pass
+        layer = garray.array()
+        # fill the new grass array with the contents from the file
+        layer.read(grassmapname)
+        self.setlayer(layername, layer, force)
     def createlayer(self, layername, grassmapname=False):
         """
         Create a new layer and add it to the layer collection



More information about the grass-commit mailing list