[GRASS-SVN] r54477 - grass/trunk/gui/wxpython/iclass
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 1 10:49:35 PST 2013
Author: martinl
Date: 2013-01-01 10:49:35 -0800 (Tue, 01 Jan 2013)
New Revision: 54477
Modified:
grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
Log:
g.gui.iclass: add new parameter to load training map
Modified: grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-01-01 17:16:17 UTC (rev 54476)
+++ grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-01-01 18:49:35 UTC (rev 54477)
@@ -35,6 +35,12 @@
#% description: Name of raster map to load
#% required: no
#%end
+#%option G_OPT_V_MAP
+#% key: trainingmap
+#% label: Ground truth training map to load
+#% description:
+#% required: no
+#%end
import os
import sys
@@ -61,6 +67,10 @@
map_name = grass.find_file(name = options['map'], element = 'cell')['fullname']
if not map_name:
grass.fatal(_("Raster map <%s> not found") % options['map'])
+ if options['trainingmap']:
+ trainingmap_name = grass.find_file(name = options['trainingmap'], element = 'vector')['fullname']
+ if not trainingmap_name:
+ grass.fatal(_("Vector map <%s> not found") % options['trainingmap'])
# define display driver
driver = UserSettings.Get(group = 'display', key = 'driver', subkey = 'type')
@@ -81,7 +91,11 @@
if map_name:
giface.WriteLog(_("Loading raster map <%s>...") % map_name)
frame.trainingMapManager.AddLayer(map_name)
+ if trainingmap_name:
+ giface.WriteLog(_("Loading training map <%s>...") % trainingmap_name)
+ frame.ImportAreas(trainingmap_name)
+ frame.CenterOnScreen()
frame.Show()
app.MainLoop()
More information about the grass-commit
mailing list