4 @brief Layer Manager - main menu, layer management toolbar, notebook
5 control for display management and access to command console.
10 (C) 2006-2014 by the GRASS Development Team
12 This program is free software under the GNU General Public License
13 (>=v2). Read the file COPYING that comes with GRASS for details.
15 @author Michael Barton (Arizona State University)
16 @author Jachym Cepicky (Mendel University of Agriculture)
17 @author Martin Landa <landa.martin gmail.com>
18 @author Vaclav Petras <wenzeslaus gmail.com> (menu customization)
27 import xml.etree.ElementTree
as etree
29 import elementtree.ElementTree
as etree
31 from core
import globalvar
35 import wx.lib.agw.flatnotebook
as FN
37 import wx.lib.flatnotebook
as FN
39 sys.path.append(os.path.join(globalvar.ETCDIR,
"python"))
42 from core.gcmd import Command, RunCommand, GError, GMessage
47 from lmgr.menudata
import ManagerData
49 from modules.mcalc_builder
import MapCalcFrame
51 from core.workspace import ProcessWorkspaceFile, ProcessGrcFile, WriteWorkspaceFile
53 from gui_core.dialogs import DxfImportDialog, GdalImportDialog, MapLayersDialog
54 from gui_core.dialogs import LocationDialog, MapsetDialog, CreateNewVector, GroupDialog
55 from modules.ogc_services
import WMSDialog
56 from modules.colorrules
import RasterColorTable, VectorColorTable
64 from lmgr.toolbars import LMWorkspaceToolbar, LMDataToolbar, LMToolsToolbar
65 from lmgr.toolbars import LMMiscToolbar, LMVectorToolbar, LMNvizToolbar
67 from gui_core.forms
import GUI
72 """!Layer Manager frame with notebook widget for controlling GRASS
73 GIS. Includes command console page for typing GRASS (and other)
74 commands, tree widget page for managing map layers.
76 def __init__(self, parent, id = wx.ID_ANY, title = None,
78 size = globalvar.GM_WINDOW_SIZE, style = wx.DEFAULT_FRAME_STYLE, **kwargs):
83 self.
baseTitle = _(
"GRASS GIS %s Layer Manager") % grass.version()[
'version']
86 wx.Frame.__init__(self, parent = parent, id = id, size = size,
87 style = style, **kwargs)
89 self.SetName(
"LayerManager")
91 self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR,
'grass.ico'), wx.BITMAP_TYPE_ICO))
93 self.
_auimgr = wx.aui.AuiManager(self)
106 self.
dialogs[
'preferences'] =
None
113 self.
toolbars = {
'workspace' : LMWorkspaceToolbar(parent = self),
114 'data' : LMDataToolbar(parent = self),
115 'tools' : LMToolsToolbar(parent = self),
116 'misc' : LMMiscToolbar(parent = self),
117 'vector' : LMVectorToolbar(parent = self),
118 'nviz' : LMNvizToolbar(parent = self)}
121 _(
"Workspace Toolbar"),
123 'data' : (
"toolbarData",
126 'misc' : (
"toolbarMisc",
129 'tools' : (
"toolbarTools",
132 'vector' : (
"toolbarVector",
135 'nviz' : (
"toolbarNviz",
136 _(
"3D view Toolbar"),
139 if sys.platform ==
'win32':
141 'vector',
'tools',
'misc',
'nviz')
144 'nviz',
'misc',
'tools',
'vector')
147 self._auimgr.AddPane(self.
toolbars[toolbar],
148 wx.aui.AuiPaneInfo().
149 Name(name).Caption(caption).
150 ToolbarPane().Top().Row(row).
151 LeftDockable(
False).RightDockable(
False).
152 BottomDockable(
False).TopDockable(
True).
153 CloseButton(
False).Layer(2).
154 BestSize((self.
toolbars[toolbar].GetBestSize())))
156 self._auimgr.GetPane(
'toolbarNviz').Hide()
159 self.Bind(wx.EVT_KEY_DOWN, self.
OnKeyDown)
162 self.SetMinSize((500, 400))
165 self._auimgr.AddPane(self.
notebook, wx.aui.AuiPaneInfo().
166 Left().CentrePane().BestSize((-1,-1)).Dockable(
False).
167 CloseButton(
False).DestroyOnClose(
True).Row(1).Layer(0))
169 self._auimgr.Update()
171 wx.CallAfter(self.notebook.SetSelectionByName,
'layers')
174 if UserSettings.Get(group =
'general', key =
'defWindowPos', subkey =
'enabled'):
175 dim = UserSettings.Get(group =
'general', key =
'defWindowPos', subkey =
'dim')
177 x, y = map(int, dim.split(
',')[0:2])
178 w, h = map(int, dim.split(
',')[2:4])
179 self.SetPosition((x, y))
202 if self.
curr_page and not self.curr_page.maptree.mapdisplay.IsShown():
203 self.curr_page.maptree.mapdisplay.Show()
206 self.goutput.Redirect()
209 self.goutput.SetSashPosition(int(self.GetSize()[1] * .8))
215 self.curr_page.maptree.mapdisplay.Raise()
216 wx.CallAfter(self.Raise)
218 def _createMenuBar(self):
219 """!Creates menu bar"""
220 self.
menubar = Menu(parent = self, data = ManagerData())
224 def _createTabMenu(self):
225 """!Creates context menu for display tabs.
227 Used to rename display.
230 item = wx.MenuItem(menu, id = wx.ID_ANY, text = _(
"Rename Map Display"))
231 menu.AppendItem(item)
236 def _setCopyingOfSelectedText(self):
237 copy = UserSettings.Get(group =
'manager', key =
'copySelectedTextToClipboard', subkey =
'enabled')
238 self.goutput.SetCopyingOfSelectedText(copy)
241 """!Check if pane (toolbar, ...) of given name is currently shown"""
242 if self._auimgr.GetPane(name).IsOk():
243 return self._auimgr.GetPane(name).IsShown()
246 def _createNoteBook(self):
247 """!Creates notebook widgets"""
248 self.
notebook = GNotebook(parent = self, style = globalvar.FNPageDStyle)
250 cbStyle = globalvar.FNPageStyle
252 self.
gm_cb = FN.FlatNotebook(self, id = wx.ID_ANY, agwStyle = cbStyle)
254 self.
gm_cb = FN.FlatNotebook(self, id = wx.ID_ANY, style = cbStyle)
255 self.gm_cb.SetTabAreaColour(globalvar.FNPageColor)
257 self.gm_cb.SetRightClickMenu(menu)
258 self.notebook.AddPage(page = self.
gm_cb, text = _(
"Map layers"), name =
'layers')
262 self.notebook.AddPage(page = self.
goutput, text = _(
"Command console"), name =
'output')
266 if not UserSettings.Get(group =
'manager', key =
'hideTabs', subkey =
'search'):
267 self.
search = MenuTreeWindow(parent = self)
268 self.notebook.AddPage(page = self.
search, text = _(
"Search module"), name =
'search')
273 if not UserSettings.Get(group =
'manager', key =
'hideTabs', subkey =
'pyshell'):
275 self.notebook.AddPage(page = self.
pyshell, text = _(
"Python shell"), name =
'pyshell')
280 self.gm_cb.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.
OnCBPageChanged)
281 self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.
OnPageChanged)
282 self.gm_cb.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CLOSING, self.
OnCBPageClosed)
287 """!Add nviz notebook page"""
288 Debug.msg(5,
"GMFrame.AddNvizTools()")
295 self._auimgr.GetPane(
'toolbarNviz').Show()
297 for pos, toolbar
in enumerate((
'toolbarVector',
'toolbarTools',
'toolbarMisc',
'toolbarNviz')):
298 self._auimgr.GetPane(toolbar).Row(2).Position(pos)
299 self._auimgr.Update()
303 display = self.curr_page.maptree.GetMapDisplay())
304 idx = self.notebook.GetPageIndexByName(
'layers')
305 self.notebook.InsertPage(indx = idx + 1, page = self.
nviz, text = _(
"3D view"), name =
'nviz')
306 self.notebook.SetSelectionByName(
'nviz')
310 """!Remove nviz notebook page"""
312 self.notebook.SetSelectionByName(
'layers')
313 self.notebook.DeletePage(self.notebook.GetPageIndexByName(
'nviz'))
316 self._auimgr.GetPane(
'toolbarNviz').Hide()
317 for pos, toolbar
in enumerate((
'toolbarVector',
'toolbarTools',
'toolbarMisc')):
318 self._auimgr.GetPane(toolbar).Row(2).Position(pos)
319 self._auimgr.Update()
322 """!Update window title"""
330 """!Launch location wizard"""
334 gWizard = LocationWizard(parent = self,
335 grassdatabase = grass.gisenv()[
'GISDBASE'])
336 location = gWizard.location
339 dlg = wx.MessageDialog(parent = self,
340 message = _(
'Location <%s> created.\n\n'
341 'Do you want to switch to the '
342 'new location?') % location,
343 caption=_(
"Switch to new location?"),
344 style = wx.YES_NO | wx.NO_DEFAULT |
345 wx.ICON_QUESTION | wx.CENTRE)
347 ret = dlg.ShowModal()
352 mapset =
'PERMANENT') != 0:
355 GMessage(parent = self,
356 message = _(
"Current location is <%(loc)s>.\n"
357 "Current mapset is <%(mapset)s>.") % \
358 {
'loc' : location,
'mapset' :
'PERMANENT' })
361 dlg = wx.MessageDialog(parent = self,
362 message = _(
"Do you want to set the default "
363 "region extents and resolution now?"),
364 caption = _(
"Location <%s> created") % location,
365 style = wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
367 if dlg.ShowModal() == wx.ID_YES:
369 defineRegion = RegionDef(self, location = location)
370 defineRegion.CenterOnScreen()
371 defineRegion.ShowModal()
372 defineRegion.Destroy()
377 """!Here can be functions which have to be called after EVT_SETTINGS_CHANGED.
378 Now only set copying of selected text to clipboard (in goutput).
384 """!Launch georectifier module
389 """!Launch Graphical Modeler"""
396 """!Launch Cartographic Composer
404 """Command execution finished"""
405 if hasattr(self,
"model"):
406 self.model.DeleteIntermediateData(log = self.
goutput)
408 self.SetStatusText(
'')
413 dlg = wx.FileDialog(parent = self, message =_(
"Choose model to run"),
414 defaultDir = os.getcwd(),
415 wildcard = _(
"GRASS Model File (*.gxm)|*.gxm"))
416 if dlg.ShowModal() == wx.ID_OK:
417 filename = dlg.GetPath()
424 self.model.LoadModel(filename)
425 self.model.Run(log = self.
goutput, onDone = self.
OnDone, parent = self)
430 """!Launch mapset access dialog
432 dlg = MapsetAccess(parent = self, id = wx.ID_ANY)
435 if dlg.ShowModal() == wx.ID_OK:
436 ms = dlg.GetMapsets()
439 mapset =
'%s' %
','.join(ms))
442 """!Page in notebook (display) changed"""
443 self.
curr_page = self.gm_cb.GetCurrentPage()
446 self.curr_page.maptree.mapdisplay.SetFocus()
447 self.curr_page.maptree.mapdisplay.Raise()
454 """!Page in notebook changed"""
455 page = event.GetSelection()
456 if page == self.notebook.GetPageIndexByName(
'output'):
458 self.notebook.SetPageText(page, _(
"Command console"))
459 wx.CallAfter(self.goutput.ResetFocus)
460 self.SetStatusText(
'', 0)
465 """!Page of notebook closed
466 Also close associated map display
468 if UserSettings.Get(group =
'manager', key =
'askOnQuit', subkey =
'enabled'):
469 maptree = self.curr_page.maptree
472 message = _(
"Do you want to save changes in the workspace?")
474 message = _(
"Do you want to store current settings "
475 "to workspace file?")
478 if maptree.GetCount() > 0:
480 dlg = wx.MessageDialog(self,
482 caption = _(
"Close Map Display %s") % name,
483 style = wx.YES_NO | wx.YES_DEFAULT |
484 wx.CANCEL | wx.ICON_QUESTION | wx.CENTRE)
485 ret = dlg.ShowModal()
491 elif ret == wx.ID_CANCEL:
497 self.gm_cb.GetPage(event.GetSelection()).maptree.Map.Clean()
498 self.gm_cb.GetPage(event.GetSelection()).maptree.Close(
True)
505 """!Get current layer tree"""
507 return self.curr_page.maptree
511 """!Get widget for command output"""
515 """!Get GRASS command from menu item
517 Return command as a list"""
521 cmd = self.
menucmd[event.GetId()]
524 cmdlist = cmd.split(
' ')
530 if cmd
in [
'vcolors',
'r.mapcalc',
'r3.mapcalc']:
534 layer = self.curr_page.maptree.layer_selected
535 name = self.curr_page.maptree.GetPyData(layer)[0][
'maplayer'].name
536 type = self.curr_page.maptree.GetPyData(layer)[0][
'type']
540 if layer
and len(cmdlist) == 1:
541 if (type ==
'raster' and cmdlist[0][0] ==
'r' and cmdlist[0][1] != '3') or \
542 (type == 'vector' and cmdlist[0][0] == 'v'):
543 input = GUI().GetCommandInputMapParamKey(cmdlist[0])
545 cmdlist.append(
"%s=%s" % (input, name))
550 """!Run command selected from menu"""
553 self.goutput.RunCmd(cmd, switchPage =
False)
556 """!Parse command selected from menu"""
559 GUI(parent = self).ParseCommand(cmd)
562 """!Start vector digitizer
569 layer = tree.layer_selected
577 mapLayer = tree.GetPyData(layer)[0][
'maplayer']
581 if not mapLayer
or mapLayer.GetType() !=
'vector':
582 GMessage(parent = self,
583 message = _(
"Selected map layer is not vector."))
586 if mapLayer.GetMapset() != grass.gisenv()[
'MAPSET']:
587 GMessage(parent = self,
588 message = _(
"Editing is allowed only for vector maps from the "
592 if not tree.GetPyData(layer)[0]:
594 dcmd = tree.GetPyData(layer)[0][
'cmd']
598 tree.OnStartEditing(
None)
603 dlg = wx.FileDialog(parent = self, message = _(
"Choose script file to run"),
604 defaultDir = os.getcwd(),
605 wildcard = _(
"Python script (*.py)|*.py|Bash script (*.sh)|*.sh"))
608 if dlg.ShowModal() == wx.ID_OK:
609 filename = dlg.GetPath()
614 if not os.path.exists(filename):
615 GError(parent = self,
616 message = _(
"Script file '%s' doesn't exist. "
617 "Operation canceled.") % filename)
621 if not os.access(filename, os.X_OK):
622 dlg = wx.MessageDialog(self,
623 message = _(
"Script <%s> is not executable. "
624 "Do you want to set the permissions "
625 "that allows you to run this script "
626 "(note that you must be the owner of the file)?" % \
627 os.path.basename(filename)),
628 caption = _(
"Set permission?"),
629 style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
630 if dlg.ShowModal() != wx.ID_YES:
634 mode = stat.S_IMODE(os.lstat(filename)[stat.ST_MODE])
635 os.chmod(filename, mode | stat.S_IXUSR)
637 GError(_(
"Unable to set permission. Operation canceled."), parent = self)
641 addonPath = os.getenv(
'GRASS_ADDON_PATH', [])
643 addonPath = addonPath.split(os.pathsep)
644 dirName = os.path.dirname(filename)
645 if dirName
not in addonPath:
646 addonPath.append(dirName)
647 dlg = wx.MessageDialog(self,
648 message = _(
"Directory '%s' is not defined in GRASS_ADDON_PATH. "
649 "Do you want add this directory to GRASS_ADDON_PATH?") % \
651 caption = _(
"Update Addons path?"),
652 style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
653 if dlg.ShowModal() == wx.ID_YES:
656 self.goutput.WriteCmdLog(_(
"Launching script '%s'...") % filename)
657 self.goutput.RunCmd([filename], switchPage =
True)
660 """Change current location"""
661 dlg = LocationDialog(parent = self)
662 if dlg.ShowModal() == wx.ID_OK:
663 location, mapset = dlg.GetValues()
666 if not location
or not mapset:
667 GError(parent = self,
668 message = _(
"No location/mapset provided. Operation canceled."))
673 mapset = mapset) != 0:
679 GMessage(parent = self,
680 message = _(
"Current location is <%(loc)s>.\n"
681 "Current mapset is <%(mapset)s>.") % \
682 {
'loc' : location,
'mapset' : mapset })
685 """!Create new mapset"""
686 dlg = wx.TextEntryDialog(parent = self,
687 message = _(
'Enter name for new mapset:'),
688 caption = _(
'Create new mapset'))
690 if dlg.ShowModal() == wx.ID_OK:
691 mapset = dlg.GetValue()
693 GError(parent = self,
694 message = _(
"No mapset provided. Operation canceled."))
702 GMessage(parent = self,
703 message = _(
"Current mapset is <%s>.") % mapset)
706 """Change current mapset"""
707 dlg = MapsetDialog(parent = self)
709 if dlg.ShowModal() == wx.ID_OK:
710 mapset = dlg.GetMapset()
714 GError(parent = self,
715 message = _(
"No mapset provided. Operation canceled."))
720 mapset = mapset) == 0:
721 GMessage(parent = self,
722 message = _(
"Current mapset is <%s>.") % mapset)
725 """!Create new vector map layer"""
728 {
'tool' :
'create' },
734 name = dlg.GetName(full =
True)
735 if name
and dlg.IsChecked(
'add'):
737 self.curr_page.maptree.AddLayer(ltype =
'vector',
739 lcmd = [
'd.vect',
'map=%s' % name])
743 """!Print system information"""
744 vInfo = grass.version()
748 from osgeo
import gdal
749 gdalVersion = gdal.__version__
752 gdalVersion = grass.Popen([
'gdalinfo',
'--version'], stdout = grass.PIPE).communicate()[0].rstrip(
'\n')
754 gdalVersion = _(
"unknown")
757 projVersion =
RunCommand(
'proj', getErrorMsg =
True)[1].splitlines()[0]
759 projVersion = _(
"unknown")
761 if sys.platform ==
'win32' and \
762 not os.path.exists(os.path.join(os.getenv(
"GISBASE"),
"WinGRASS-README.url")):
763 osgeo4w =
' (OSGeo4W)'
767 self.goutput.WriteCmdLog(_(
"System Info"))
771 self.goutput.WriteLog(
"%s: %s\n"
778 "%s: %s%s\n"% (_(
"GRASS version"), vInfo[
'version'],
779 _(
"GRASS SVN Revision"), vInfo[
'revision'],
781 gdalVersion, projVersion,
782 platform.python_version(),
784 _(
"Platform"), platform.platform().
decode(
'utf8', errors=
'replace'), osgeo4w),
786 self.goutput.WriteCmdLog(
' ')
789 """!Display 'About GRASS' dialog"""
790 win = AboutWindow(self)
794 def _popupMenu(self, data):
795 """!Create popup menu
797 point = wx.GetMousePosition()
800 for key, handler
in data:
802 menu.AppendSeparator()
804 item = wx.MenuItem(menu, wx.ID_ANY, LMIcons[key].GetLabel())
805 item.SetBitmap(LMIcons[key].GetBitmap(self.
iconsize))
806 menu.AppendItem(item)
807 self.Bind(wx.EVT_MENU, handler, item)
814 """!Import maps menu (import, link)
820 """!Create new workspace file
822 Erase current workspace settings first
824 Debug.msg(4,
"GMFrame.OnWorkspaceNew():")
830 maptree = self.curr_page.maptree
836 dlg = wx.MessageDialog(self, message = _(
"Current workspace is not empty. "
837 "Do you want to store current settings "
838 "to workspace file?"),
839 caption = _(
"Create new workspace?"),
840 style = wx.YES_NO | wx.YES_DEFAULT | \
841 wx.CANCEL | wx.ICON_QUESTION)
842 ret = dlg.ShowModal()
845 elif ret == wx.ID_CANCEL:
852 maptree.DeleteAllItems()
855 maptree.root = maptree.AddRoot(
"Map Layers")
856 self.curr_page.maptree.SetPyData(maptree.root, (
None,
None))
864 """!Open file with workspace definition"""
865 dlg = wx.FileDialog(parent = self, message = _(
"Choose workspace file"),
866 defaultDir = os.getcwd(), wildcard = _(
"GRASS Workspace File (*.gxw)|*.gxw"))
869 if dlg.ShowModal() == wx.ID_OK:
870 filename = dlg.GetPath()
875 Debug.msg(4,
"GMFrame.OnWorkspaceOpen(): filename=%s" % filename)
886 """!Load layer tree definition stored in GRASS Workspace XML file (gxw)
888 @todo Validate against DTD
890 @return True on success
891 @return False on error
894 dtdFilename = os.path.join(globalvar.ETCWXDIR,
"xml",
"grass-gxw.dtd")
898 gxwXml = ProcessWorkspaceFile(etree.parse(filename))
900 GError(parent = self,
901 message = _(
"Reading workspace file <%s> failed.\n"
902 "Invalid file, unable to parse XML document.") % filename)
905 busy = wx.BusyInfo(message = _(
"Please wait, loading workspace..."),
912 if not UserSettings.Get(group =
'general', key =
'workspace',
913 subkey = [
'posManager',
'enabled']):
914 if gxwXml.layerManager[
'pos']:
915 self.SetPosition(gxwXml.layerManager[
'pos'])
916 if gxwXml.layerManager[
'size']:
917 self.SetSize(gxwXml.layerManager[
'size'])
924 for display
in gxwXml.displays:
925 mapdisp = self.
NewDisplay(name = display[
'name'], show =
False)
926 mapdisplay.append(mapdisp)
927 maptree = self.gm_cb.GetPage(displayId).maptree
930 mapdisp.SetProperties(render = display[
'render'],
931 mode = display[
'mode'],
932 showCompExtent = display[
'showCompExtent'],
933 alignExtent = display[
'alignExtent'],
934 constrainRes = display[
'constrainRes'],
935 projection = display[
'projection'][
'enabled'])
937 if display[
'projection'][
'enabled']:
938 if display[
'projection'][
'epsg']:
939 UserSettings.Set(group =
'display', key =
'projection', subkey =
'epsg',
940 value = display[
'projection'][
'epsg'])
941 if display[
'projection'][
'proj']:
942 UserSettings.Set(group =
'display', key =
'projection', subkey =
'proj4',
943 value = display[
'projection'][
'proj'])
946 if not UserSettings.Get(group =
'general', key =
'workspace', subkey = [
'posDisplay',
'enabled']):
948 mapdisp.SetPosition(display[
'pos'])
950 mapdisp.SetSize(display[
'size'])
953 if display[
'extent']:
954 w, s, e, n = display[
'extent']
955 region = maptree.Map.region = maptree.Map.GetRegion(w = w, s = s, e = e, n = n)
956 mapdisp.GetWindow().ResetZoomHistory()
957 mapdisp.GetWindow().ZoomHistory(region[
'n'],
971 for layer
in gxwXml.layers:
972 display = layer[
'display']
973 maptree = self.gm_cb.GetPage(display).maptree
975 newItem = maptree.AddLayer(ltype = layer[
'type'],
976 lname = layer[
'name'],
977 lchecked = layer[
'checked'],
978 lopacity = layer[
'opacity'],
980 lgroup = layer[
'group'],
981 lnviz = layer[
'nviz'],
982 lvdigit = layer[
'vdigit'])
984 if layer.has_key(
'selected'):
985 if layer[
'selected']:
986 selected.append((maptree, newItem))
988 maptree.SelectItem(newItem, select =
False)
990 for maptree, layer
in selected:
991 if not maptree.IsSelected(layer):
992 maptree.SelectItem(layer, select =
True)
993 maptree.layer_selected = layer
997 for idx, mdisp
in enumerate(mapdisplay):
998 mdisp.MapWindow2D.UpdateMap()
1000 if gxwXml.displays[idx][
'viewMode'] ==
'3d':
1002 self.nviz.UpdateState(view = gxwXml.nviz_state[
'view'],
1003 iview = gxwXml.nviz_state[
'iview'],
1004 light = gxwXml.nviz_state[
'light'])
1005 mdisp.MapWindow3D.constants = gxwXml.nviz_state[
'constants']
1006 for idx, constant
in enumerate(mdisp.MapWindow3D.constants):
1007 mdisp.MapWindow3D.AddConstant(constant, idx + 1)
1008 for page
in (
'view',
'light',
'fringe',
'constant',
'cplane'):
1009 self.nviz.UpdatePage(page)
1010 self.nviz.UpdateSettings()
1011 mdisp.toolbars[
'map'].combo.SetSelection(1)
1018 """!Load map layers from GRC file (Tcl/Tk GUI) into map layer tree"""
1019 dlg = wx.FileDialog(parent = self, message = _(
"Choose GRC file to load"),
1020 defaultDir = os.getcwd(), wildcard = _(
"Old GRASS Workspace File (*.grc)|*.grc"))
1023 if dlg.ShowModal() == wx.ID_OK:
1024 filename = dlg.GetPath()
1029 Debug.msg(4,
"GMFrame.OnWorkspaceLoadGrcFile(): filename=%s" % filename)
1035 busy = wx.BusyInfo(message = _(
"Please wait, loading workspace..."),
1040 for layer
in ProcessGrcFile(filename).read(self):
1041 maptree = self.gm_cb.GetPage(layer[
'display']).maptree
1042 newItem = maptree.AddLayer(ltype = layer[
'type'],
1043 lname = layer[
'name'],
1044 lchecked = layer[
'checked'],
1045 lopacity = layer[
'opacity'],
1046 lcmd = layer[
'cmd'],
1047 lgroup = layer[
'group'])
1053 maptree.Map.ReverseListOfLayers()
1056 """!Save workspace definition to selected file"""
1057 dlg = wx.FileDialog(parent = self, message = _(
"Choose file to save current workspace"),
1058 defaultDir = os.getcwd(), wildcard = _(
"GRASS Workspace File (*.gxw)|*.gxw"), style = wx.FD_SAVE)
1061 if dlg.ShowModal() == wx.ID_OK:
1062 filename = dlg.GetPath()
1068 if filename[-4:] !=
".gxw":
1071 if os.path.exists(filename):
1072 dlg = wx.MessageDialog(self, message = _(
"Workspace file <%s> already exists. "
1073 "Do you want to overwrite this file?") % filename,
1074 caption = _(
"Save workspace"), style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
1075 if dlg.ShowModal() != wx.ID_YES:
1079 Debug.msg(4,
"GMFrame.OnWorkspaceSaveAs(): filename=%s" % filename)
1086 """!Save file with workspace definition"""
1088 dlg = wx.MessageDialog(self, message = _(
"Workspace file <%s> already exists. "
1089 "Do you want to overwrite this file?") % \
1091 caption = _(
"Save workspace"), style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
1092 if dlg.ShowModal() == wx.ID_NO:
1095 Debug.msg(4,
"GMFrame.OnWorkspaceSave(): filename=%s" % self.
workspaceFile)
1103 """!Save layer tree layout to workspace file
1105 Return True on success, False on error
1107 tmpfile = tempfile.TemporaryFile(mode =
'w+b')
1109 WriteWorkspaceFile(lmgr = self, file = tmpfile)
1110 except StandardError, e:
1111 GError(parent = self,
1112 message = _(
"Writing current settings to workspace file "
1117 mfile = open(filename,
"w")
1119 for line
in tmpfile.readlines():
1122 GError(parent = self,
1123 message = _(
"Unable to open file <%s> for writing.") % filename)
1131 """!Close file with workspace definition
1133 If workspace has been modified ask user to save the changes.
1135 Debug.msg(4,
"GMFrame.OnWorkspaceClose(): file=%s" % self.
workspaceFile)
1145 """!Close current map display window
1147 if self.
curr_page and self.curr_page.maptree.mapdisplay:
1148 self.curr_page.maptree.mapdisplay.OnCloseWindow(event)
1151 """!Close all open map display windows
1154 for page
in range(0, self.gm_cb.GetPageCount()):
1155 displays.append(self.gm_cb.GetPage(page).maptree.mapdisplay)
1157 for display
in displays:
1158 display.OnCloseWindow(event)
1161 """!Change Map Display name"""
1163 dlg = wx.TextEntryDialog(self, message = _(
"Enter new name:"),
1164 caption = _(
"Rename Map Display"), defaultValue = name)
1165 if dlg.ShowModal() == wx.ID_OK:
1166 name = dlg.GetValue()
1167 self.gm_cb.SetPageText(page = self.
curr_pagenum, text = name)
1168 mapdisplay = self.curr_page.maptree.mapdisplay
1169 mapdisplay.SetTitle(_(
"GRASS GIS %(version) Map Display: %(name)s - Location: %(loc)s") % \
1170 {
'version' : grass.version()[
'version'],
1172 'loc' : grass.gisenv()[
"LOCATION_NAME"] })
1176 """!Launches dialog for commands that need rules input and
1181 if cmd[0] ==
'r.colors':
1182 ctable = RasterColorTable(self)
1184 ctable = VectorColorTable(self, attributeType =
'color')
1185 ctable.CentreOnScreen()
1190 Run commands that need xterm
1192 self.
OnXTerm(event, need_xmon =
False)
1196 Run commands that need interactive xmon
1198 @param need_xmon True to start X monitor
1201 if os.getenv(
'GRASS_RENDER_IMMEDIATE'):
1202 del os.environ[
'GRASS_RENDER_IMMEDIATE']
1213 for line
in ret.split(
'\n'):
1215 if line.startswith(
'x')
and 'not running' in line:
1216 xmonlist.append(line[0:2])
1222 cmdlist = [
'd.mon', xmon]
1223 p = Command(cmdlist, wait=
False)
1227 command =
' '.join(command)
1229 gisbase = os.environ[
'GISBASE']
1231 if sys.platform ==
"win32":
1232 runbat = os.path.join(gisbase,
'etc',
'grass-run.bat')
1233 cmdlist = [
"start", runbat, runbat, command]
1235 if sys.platform ==
"darwin":
1236 xtermwrapper = os.path.join(gisbase,
'etc',
'grass-xterm-mac')
1238 xtermwrapper = os.path.join(gisbase,
'etc',
'grass-xterm-wrapper')
1240 grassrun = os.path.join(gisbase,
'etc',
'grass-run.sh')
1241 cmdlist = [xtermwrapper,
'-e', grassrun, command]
1243 p = Command(cmdlist, wait=
False)
1246 os.environ[
'GRASS_RENDER_IMMEDIATE'] =
'TRUE'
1249 """!Show dialog for creating and editing groups.
1251 dlg = GroupDialog(self)
1252 dlg.CentreOnScreen()
1256 """!Install extension from GRASS Addons SVN repository"""
1257 win = InstallExtensionWindow(self, size = (650, 550))
1258 win.CentreOnScreen()
1262 """!Uninstall extension"""
1263 win = UninstallExtensionWindow(self, size = (650, 300))
1264 win.CentreOnScreen()
1268 """!General GUI preferences/settings
1270 if not self.
dialogs[
'preferences']:
1271 dlg = PreferencesDialog(parent = self)
1272 self.
dialogs[
'preferences'] = dlg
1273 self.
dialogs[
'preferences'].CenterOnScreen()
1277 self.
dialogs[
'preferences'].ShowModal()
1282 self.goutput.RunCmd([
'g.manual',
'-i'])
1285 """!Init histogram display canvas and tools
1288 win = HistogramFrame(self)
1290 win.CentreOnScreen()
1296 """!Launch profile tool
1300 win.CentreOnParent()
1306 """!Init map calculator for interactive creation of mapcalc statements
1314 win = MapCalcFrame(parent = self,
1316 win.CentreOnScreen()
1320 """!Init interactive vector cleaning
1322 from modules.vclean
import VectorCleaningFrame
1323 win = VectorCleaningFrame(parent = self)
1324 win.CentreOnScreen()
1328 """!Convert multiple DXF layers to GRASS vector map layers"""
1329 dlg = DxfImportDialog(parent = self)
1330 dlg.CentreOnScreen()
1334 """!Convert multiple GDAL layers to GRASS raster map layers"""
1335 dlg = GdalImportDialog(parent = self)
1336 dlg.CentreOnScreen()
1340 """!Link multiple GDAL layers to GRASS raster map layers"""
1341 dlg = GdalImportDialog(parent = self, link =
True)
1342 dlg.CentreOnScreen()
1346 """!Convert multiple OGR layers to GRASS vector map layers"""
1347 dlg = GdalImportDialog(parent = self, ogr =
True)
1348 dlg.CentreOnScreen()
1352 """!Links multiple OGR layers to GRASS vector map layers"""
1353 dlg = GdalImportDialog(parent = self, ogr =
True, link =
True)
1354 dlg.CentreOnScreen()
1358 """!Import data from OGC WMS server"""
1359 dlg = WMSDialog(parent = self, service =
'wms')
1360 dlg.CenterOnScreen()
1362 if dlg.ShowModal() == wx.ID_OK:
1363 layers = dlg.GetLayers()
1365 if len(layers.keys()) > 0:
1366 for layer
in layers.keys():
1368 'mapserver=%s' % dlg.GetSettings()[
'server'],
1369 'layers=%s' % layer,
1370 'output=%s' % layer,
1373 styles =
','.join(layers[layer])
1375 cmd.append(
'styles=%s' % styles)
1376 self.goutput.RunCmd(cmd, switchPage =
True)
1378 self.curr_page.maptree.AddLayer(ltype =
'raster',
1380 lcmd = [
'd.rast',
'map=%s' % layer],
1383 self.goutput.WriteWarning(_(
"Nothing to import. No WMS layer selected."))
1389 """!Show attribute table of the given vector map layer
1396 layer = tree.layer_selected
1404 maptype = tree.GetPyData(layer)[0][
'maplayer'].type
1408 if not maptype
or maptype !=
'vector':
1409 GMessage(parent = self,
1410 message = _(
"Selected map layer is not vector."))
1413 if not tree.GetPyData(layer)[0]:
1415 dcmd = tree.GetPyData(layer)[0][
'cmd']
1419 busy = wx.BusyInfo(message = _(
"Please wait, loading attribute data..."),
1423 dbmanager = AttributeManager(parent = self, id = wx.ID_ANY,
1424 size = wx.Size(500, 300),
1425 item = layer, log = self.
goutput,
1426 selection = selection)
1431 self.
dialogs[
'atm'].append(dbmanager)
1437 """!Create new layer tree and map display instance"""
1438 self.NewDisplayWMS()
1441 """!Create new layer tree and map display instance"""
1445 """!Create new layer tree, which will
1446 create an associated map display frame
1448 @param name name of new map display
1449 @param show show map display window if True
1451 @return reference to mapdisplay intance
1453 Debug.msg(1,
"GMFrame.NewDisplay(): idx=%d" % self.
disp_idx)
1460 dispName =
"Display " + str(self.
disp_idx + 1)
1461 self.gm_cb.AddPage(self.
pg_panel, text = dispName, select =
True)
1462 self.
curr_page = self.gm_cb.GetCurrentPage()
1465 self.curr_page.maptree = LayerTree(self.
curr_page, id = wx.ID_ANY, pos = wx.DefaultPosition,
1466 size = wx.DefaultSize, style = wx.TR_HAS_BUTTONS |
1467 wx.TR_LINES_AT_ROOT| wx.TR_HIDE_ROOT |
1468 wx.TR_DEFAULT_STYLE| wx.NO_BORDER | wx.FULL_REPAINT_ON_RESIZE,
1470 auimgr = self.
_auimgr, showMapDisplay = show)
1473 cb_boxsizer = wx.BoxSizer(wx.VERTICAL)
1474 cb_boxsizer.Add(self.curr_page.maptree, proportion = 1, flag = wx.EXPAND, border = 1)
1475 self.curr_page.SetSizer(cb_boxsizer)
1476 cb_boxsizer.Fit(self.curr_page.maptree)
1477 self.curr_page.Layout()
1478 self.curr_page.maptree.Layout()
1481 if UserSettings.Get(group =
'general', key =
'defWindowPos', subkey =
'enabled'):
1482 dim = UserSettings.Get(group =
'general', key =
'defWindowPos', subkey =
'dim')
1485 x, y = map(int, dim.split(
',')[idx:idx + 2])
1486 w, h = map(int, dim.split(
',')[idx + 2:idx + 4])
1487 self.curr_page.maptree.mapdisplay.SetPosition((x, y))
1488 self.curr_page.maptree.mapdisplay.SetSize((w, h))
1494 return self.curr_page.maptree.mapdisplay
1497 """!Add selected map layers into layer tree"""
1498 dialog = MapLayersDialog(parent = self, title = _(
"Add selected map layers into layer tree"))
1500 if dialog.ShowModal() != wx.ID_OK:
1508 maptree = self.curr_page.maptree
1510 for layerName
in dialog.GetMapLayers():
1511 ltype = dialog.GetLayerType(cmd =
True)
1513 cmd = [
'd.rast',
'map=%s' % layerName]
1515 elif ltype ==
'rast3d':
1516 cmd = [
'd.rast3d',
'map=%s' % layerName]
1517 wxType =
'3d-raster'
1518 elif ltype ==
'vect':
1519 cmd = [
'd.vect',
'map=%s' % layerName]
1522 GError(parent = self,
1523 message = _(
"Unsupported map layer type <%s>.") % ltype)
1526 newItem = maptree.AddLayer(ltype = wxType,
1535 """!Add raster map layer"""
1540 self.notebook.SetSelectionByName(
'layers')
1541 self.curr_page.maptree.AddLayer(
'raster')
1544 """!Create misc raster popup-menu"""
1560 self.curr_page.maptree.mapdisplay.Show()
1563 """!Add vector map to the current layer tree"""
1568 self.notebook.SetSelectionByName(
'layers')
1569 self.curr_page.maptree.AddLayer(
'vector')
1572 """!Create misc vector popup-menu"""
1581 self.curr_page.maptree.mapdisplay.Show()
1584 """!Add thematic vector map to the current layer tree"""
1585 self.notebook.SetSelectionByName(
'layers')
1586 self.curr_page.maptree.AddLayer(
'thememap')
1589 """!Add chart vector map to the current layer tree"""
1590 self.notebook.SetSelectionByName(
'layers')
1591 self.curr_page.maptree.AddLayer(
'themechart')
1594 """!Create decoration overlay menu"""
1607 self.curr_page.maptree.mapdisplay.Show()
1610 """!Add 3D raster map to the current layer tree"""
1611 self.notebook.SetSelectionByName(
'layers')
1612 self.curr_page.maptree.AddLayer(
'3d-raster')
1615 """!Add RGB raster map to the current layer tree"""
1616 self.notebook.SetSelectionByName(
'layers')
1617 self.curr_page.maptree.AddLayer(
'rgb')
1620 """!Add HIS raster map to the current layer tree"""
1621 self.notebook.SetSelectionByName(
'layers')
1622 self.curr_page.maptree.AddLayer(
'his')
1625 """!Add shaded relief raster map to the current layer tree"""
1626 self.notebook.SetSelectionByName(
'layers')
1627 self.curr_page.maptree.AddLayer(
'shaded')
1630 """!Add flow arrows raster map to the current layer tree"""
1631 self.notebook.SetSelectionByName(
'layers')
1632 tree = self.curr_page.maptree
1633 resolution = tree.GetMapDisplay().GetProperty(
'resolution')
1636 if dlg.ShowModal() == wx.ID_YES:
1637 tree.GetMapDisplay().SetProperty(
'resolution',
True)
1640 self.curr_page.maptree.AddLayer(
'rastarrow')
1643 """!Add cell number raster map to the current layer tree"""
1644 self.notebook.SetSelectionByName(
'layers')
1645 tree = self.curr_page.maptree
1646 resolution = tree.GetMapDisplay().GetProperty(
'resolution')
1648 limitText = _(
"Note that cell values can only be displayed for "
1649 "regions of less than 10,000 cells.")
1651 if dlg.ShowModal() == wx.ID_YES:
1652 tree.GetMapDisplay().SetProperty(
'resolution',
True)
1658 self.curr_page.maptree.AddLayer(
'rastnum')
1661 """!Add command line map layer to the current layer tree"""
1666 self.notebook.SetSelectionByName(
'layers')
1667 self.curr_page.maptree.AddLayer(
'command')
1670 self.curr_page.maptree.mapdisplay.Show()
1673 """!Add layer group"""
1678 self.notebook.SetSelectionByName(
'layers')
1679 self.curr_page.maptree.AddLayer(
'group')
1682 self.curr_page.maptree.mapdisplay.Show()
1685 """!Add grid map layer to the current layer tree"""
1686 self.notebook.SetSelectionByName(
'layers')
1687 self.curr_page.maptree.AddLayer(
'grid')
1690 """!Add geodesic line map layer to the current layer tree"""
1691 self.notebook.SetSelectionByName(
'layers')
1692 self.curr_page.maptree.AddLayer(
'geodesic')
1695 """!Add rhumb map layer to the current layer tree"""
1696 self.notebook.SetSelectionByName(
'layers')
1697 self.curr_page.maptree.AddLayer(
'rhumb')
1700 """!Add vector labels map layer to the current layer tree"""
1705 self.notebook.SetSelectionByName(
'layers')
1706 self.curr_page.maptree.AddLayer(
'labels')
1709 self.curr_page.maptree.mapdisplay.Show()
1712 """!Remove selected map layer from the current layer Tree
1714 if not self.
curr_page or not self.curr_page.maptree.layer_selected:
1718 if UserSettings.Get(group =
'manager', key =
'askOnRemoveLayer', subkey =
'enabled'):
1720 for item
in self.curr_page.maptree.GetSelections():
1721 name = self.curr_page.maptree.GetItemText(item)
1722 idx = name.find(
'(' + _(
'opacity:'))
1724 layerName +=
'<' + name[:idx].strip(
' ') +
'>,\n'
1726 layerName +=
'<' + name +
'>,\n'
1727 layerName = layerName.rstrip(
',\n')
1729 if len(layerName) > 2:
1730 message = _(
"Do you want to remove map layer(s)\n%s\n"
1731 "from layer tree?") % layerName
1733 message = _(
"Do you want to remove selected map layer(s) "
1736 dlg = wx.MessageDialog (parent = self, message = message,
1737 caption = _(
"Remove map layer"),
1738 style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
1740 if dlg.ShowModal() != wx.ID_YES:
1746 for layer
in self.curr_page.maptree.GetSelections():
1747 if self.curr_page.maptree.GetPyData(layer)[0][
'type'] ==
'group':
1748 self.curr_page.maptree.DeleteChildren(layer)
1749 self.curr_page.maptree.Delete(layer)
1753 kc = event.GetKeyCode()
1755 if event.ControlDown():
1756 if kc == wx.WXK_TAB:
1758 if self.notebook.GetSelection() == self.notebook.GetPageIndexByName(
'layers'):
1759 self.notebook.SetSelectionByName(
'output')
1761 self.notebook.SetSelectionByName(
'layers')
1769 if event.CtrlDown():
1778 """!Cleanup when wxGUI is quitted"""
1780 if self.goutput.btnCmdProtocol.GetValue():
1781 self.goutput.CmdProtocolSave()
1784 self._auimgr.UnInit()
1789 maptree = self.curr_page.maptree
1791 UserSettings.Get(group =
'manager', key =
'askOnQuit', subkey =
'enabled'):
1793 message = _(
"Do you want to save changes in the workspace?")
1795 message = _(
"Do you want to store current settings "
1796 "to workspace file?")
1799 if maptree.GetCount() > 0:
1800 dlg = wx.MessageDialog(self,
1802 caption = _(
"Quit GRASS GUI"),
1803 style = wx.YES_NO | wx.YES_DEFAULT |
1804 wx.CANCEL | wx.ICON_QUESTION | wx.CENTRE)
1805 ret = dlg.ShowModal()
1806 if ret == wx.ID_YES:
1811 elif ret == wx.ID_CANCEL:
1813 if hasattr(event,
'Veto'):
1820 UserSettings.Set(group =
'manager', key =
'askOnQuit', subkey =
'enabled',
1825 self.gm_cb.DeleteAllPages()
1827 self._auimgr.UnInit()
1831 """!Show dialog message 'No layer selected'"""
1832 wx.MessageBox(parent = self,
1833 message = _(
"No map layer selected. Operation canceled."),
1834 caption = _(
"Message"),
1835 style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
1838 """!Returns dialog for d.rast.num, d.rast.arrow
1839 when display resolution is not constrained
1841 @param limitText adds a note about cell limit
1843 message = _(
"Display resolution is currently not constrained to "
1844 "computational settings. "
1845 "It's suggested to constrain map to region geometry. "
1846 "Do you want to constrain "
1849 message +=
"\n\n%s" % _(limitText)
1850 dlg = wx.MessageDialog(parent = self,
1852 caption = _(
"Constrain map to region geometry?"),
1853 style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION | wx.CENTRE)
def MsgNoLayerSelected
Show dialog message 'No layer selected'.
def OnVectorCleaning
Init interactive vector cleaning.
def IsPaneShown
Check if pane (toolbar, ...) of given name is currently shown.
def OnRunScript
Run script.
def OnNewDisplayWMS
Create new layer tree and map display instance.
def OnProfile
Launch profile tool.
def OnXTermNoXMon
Run commands that need xterm.
def OnCreateMapset
Create new mapset.
def OnAddRasterShaded
Add shaded relief raster map to the current layer tree.
def _createNoteBook
Creates notebook widgets.
def OnAddRaster
Add raster map layer.
def OnDisplayClose
Close current map display window.
def OnVDigit
Start vector digitizer.
def _createTabMenu
Creates context menu for display tabs.
def _createMenuBar
Creates menu bar.
Location wizard - dialogs.
wxGUI Graphical Modeler (base classes & read/write)
Location wizard - creates a new GRASS Location.
def OnImportMenu
Import maps menu (import, link)
def OnSettingsChanged
Here can be functions which have to be called after EVT_SETTINGS_CHANGED.
def OnNewDisplay
Create new layer tree and map display instance.
def OnHistogram
Init histogram display canvas and tools.
Layer Manager frame with notebook widget for controlling GRASS GIS.
wxGUI Interactive Python Shell for Layer Manager
def OnDeleteLayer
Remove selected map layer from the current layer Tree.
def OnImportWMS
Import data from OGC WMS server.
def AddNvizTools
Add nviz notebook page.
def OnUninstallExtension
Uninstall extension.
def OnPsMap
Launch Cartographic Composer.
def RemoveNvizTools
Remove nviz notebook page.
def OnImportGdalLayers
Convert multiple GDAL layers to GRASS raster map layers.
Open/save workspace definition file.
def OnCBPageChanged
Page in notebook (display) changed.
GRASS Attribute Table Manager.
def OnAddRasterHIS
Add HIS raster map to the current layer tree.
def OnLinkOgrLayers
Links multiple OGR layers to GRASS vector map layers.
def OnGModeler
Launch Graphical Modeler.
Various dialogs used in wxGUI.
def _popupMenu
Create popup menu.
def OnAddRaster3D
Add 3D raster map to the current layer tree.
def OnAddVectorChart
Add chart vector map to the current layer tree.
wxGUI Graphical Modeler for creating, editing, and managing models
def OnEditImageryGroups
Show dialog for creating and editing groups.
def OnPreferences
General GUI preferences/settings.
def RulesCmd
Launches dialog for commands that need rules input and processes rules.
def SetAddOnPath
Set default AddOn path.
def OnAddVectorMisc
Create misc vector popup-menu.
Georectification module for GRASS GIS.
Plotting histogram based on d.histogram.
def OnDisplayCloseAll
Close all open map display windows.
def OnAddMaps
Add selected map layers into layer tree.
def OnMenuCmd
Parse command selected from menu.
def OnAddLabels
Add vector labels map layer to the current layer tree.
def OnAddVector
Add vector map to the current layer tree.
def SaveToWorkspaceFile
Save layer tree layout to workspace file.
def OnAddVectorTheme
Add thematic vector map to the current layer tree.
def OnKeyDown
Key pressed.
def GetMenuCmd
Get GRASS command from menu item.
def OnWorkspaceSaveAs
Save workspace definition to selected file.
def OnWorkspaceNew
Create new workspace file.
def OnCloseWindow
Cleanup when wxGUI is quitted.
def _setCopyingOfSelectedText
def OnAboutGRASS
Display 'About GRASS' dialog.
def CreateNewVector
Create new vector map layer.
def OnGCPManager
Launch georectifier module.
def OnInstallExtension
Install extension from GRASS Addons SVN repository.
def OnAddOverlay
Create decoration overlay menu.
def MsgDisplayResolution
Returns dialog for d.rast.num, d.rast.arrow when display resolution is not constrained.
Utility classes for map layer management.
def OnAddRasterArrow
Add flow arrows raster map to the current layer tree.
def OnAddRasterNum
Add cell number raster map to the current layer tree.
Mainframe for displaying profile of one or more raster maps.
def OnSystemInfo
Print system information.
Misc utilities for wxGUI.
def OnMapsets
Launch mapset access dialog.
def OnAddGroup
Add layer group.
def OnLinkGdalLayers
Link multiple GDAL layers to GRASS raster map layers.
def LoadWorkspaceFile
Load layer tree definition stored in GRASS Workspace XML file (gxw)
def OnMapCalculator
Init map calculator for interactive creation of mapcalc statements.
def OnAddRhumb
Add rhumb map layer to the current layer tree.
def OnAddGrid
Add grid map layer to the current layer tree.
def OnAddRasterMisc
Create misc raster popup-menu.
def OnXTerm
Run commands that need interactive xmon.
def OnWorkspaceClose
Close file with workspace definition.
def OnCBPageClosed
Page of notebook closed Also close associated map display.
GRASS Addons extensions management classes.
def OnImportDxfFile
Convert multiple DXF layers to GRASS vector map layers.
def NewDisplay
Create new layer tree, which will create an associated map display frame.
def GetLogWindow
Get widget for command output.
def OnLocationWizard
Launch location wizard.
def OnAddCommand
Add command line map layer to the current layer tree.
def OnShowAttributeTable
Show attribute table of the given vector map layer.
def OnNewVector
Create new vector map layer.
def RunMenuCmd
Run command selected from menu.
def WorkspaceChanged
Update window title.
def OnWorkspaceOpen
Open file with workspace definition.
def OnWorkspaceSave
Save file with workspace definition.
def OnRenameDisplay
Change Map Display name.
def GetLayerTree
Get current layer tree.
def OnWorkspaceLoadGrcFile
Load map layers from GRC file (Tcl/Tk GUI) into map layer tree.
def RunCommand
Run GRASS command.
def OnImportOgrLayers
Convert multiple OGR layers to GRASS vector map layers.
def OnAddRasterRGB
Add RGB raster map to the current layer tree.
def OnPageChanged
Page in notebook changed.
def OnAddGeodesic
Add geodesic line map layer to the current layer tree.