[GRASS-SVN] r68475 - grass-addons/grass7/imagery/i.segment.uspo

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 20 04:28:00 PDT 2016


Author: mlennert
Date: 2016-05-20 04:28:00 -0700 (Fri, 20 May 2016)
New Revision: 68475

Modified:
   grass-addons/grass7/imagery/i.segment.uspo/i.segment.uspo.py
Log:
i.segment.uspo: fixing bug introduce by r68413, replace '@' by '_at_' to keep track of region mapset


Modified: grass-addons/grass7/imagery/i.segment.uspo/i.segment.uspo.py
===================================================================
--- grass-addons/grass7/imagery/i.segment.uspo/i.segment.uspo.py	2016-05-20 10:10:21 UTC (rev 68474)
+++ grass-addons/grass7/imagery/i.segment.uspo/i.segment.uspo.py	2016-05-20 11:28:00 UTC (rev 68475)
@@ -557,7 +557,7 @@
     for region in regions:
 
         gscript.message("Working on region %s\n" % region)
-        parms['region'] = region.split('@')[0]
+        parms['region'] = region.replace('@', '_at_')
 
         gscript.run_command('g.region', 
                             region=region,
@@ -622,7 +622,8 @@
         rank = 1
      	for optind in optimal_indices:
 	    best_values[region].append([threshlist[optind], minsizelist[optind], optlist[optind]])
-	    maps_to_keep.append([regional_maplist[optind], rank, region])
+	    maps_to_keep.append([regional_maplist[optind], rank,
+                parms['region']])
             rank += 1
 
     # Create output
@@ -664,7 +665,7 @@
 
     if segmented_map:
         for bestmap, rank, region in maps_to_keep:
-            outputmap = segmented_map + "_" + parms['region'] + "_rank%d" % rank
+            outputmap = segmented_map + "_" + region + "_rank%d" % rank
             gscript.run_command('g.copy',
                                 raster=[bestmap,outputmap],
                                 quiet=True,



More information about the grass-commit mailing list