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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 8 07:45:12 PDT 2013


Author: mic
Date: 2013-04-08 07:45:12 -0700 (Mon, 08 Apr 2013)
New Revision: 55665

Modified:
   grass-addons/grass7/raster/r.agent/r.agent.aco
Log:
support maps with or without MAPSET

Modified: grass-addons/grass7/raster/r.agent/r.agent.aco
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.aco	2013-04-08 14:33:33 UTC (rev 55664)
+++ grass-addons/grass7/raster/r.agent/r.agent.aco	2013-04-08 14:45:12 UTC (rev 55665)
@@ -227,19 +227,32 @@
     Set the user maps in place
     """
     if site:
+        if -1 == site.find('@'):
+            site = site + '@' + grass.gisenv()['MAPSET']
         # set sitemap and site list
         world.sites = world.playground.parsevectorlayer(anthill.Anthill.SITE,
                                                         site, True)
     else:
-        raise error.DataError("aco:", "The site map is mandatory.")
+        raise error.DataError("r.agent.aco:", "The site map is mandatory.")
     if cost:
+        if -1 == cost.find('@'):
+            cost = cost + '@' + grass.gisenv()['MAPSET']
         # set cost/penalty layer
         world.playground.setgrasslayer(anthill.Anthill.COST, cost, True)
         world.overwritepenalty = wastecosts
+    else:
+        raise error.DataError("r.agent.aco:", "The cost map is mandatory.")
+    if outphero:
+        if -1 == outphero.find('@'):
+            outphero = outphero + '@' + grass.gisenv()['MAPSET']
+    else:
+        raise error.DataError("r.agent.aco:", "The output map is mandatory.")
     if inphero == outphero:
         if not wastephero:
             raise error.DataError("aco:", "May not overwrite the output map.")
     if inphero:
+        if -1 == inphero.find('@'):
+            inphero = inphero + '@' + grass.gisenv()['MAPSET']
         world.playground.setgrasslayer(anthill.Anthill.RESULT, inphero, True)
     world.playground.grassmapnames[anthill.Anthill.RESULT] = outphero
     world.overwritepheormone = wastephero



More information about the grass-commit mailing list