g.gui.gcp.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env python
  2. ############################################################################
  3. #
  4. # MODULE: GCP Manager
  5. # AUTHOR(S): Markus Metz
  6. # PURPOSE: Georectification and Ground Control Points management.
  7. # COPYRIGHT: (C) 2012 by Markus Metz, and the GRASS Development Team
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. ############################################################################
  20. #%module
  21. #% description: Georectifies a map and allows to manage Ground Control Points.
  22. #% keywords: general
  23. #% keywords: user interface
  24. #% keywords: GUI
  25. #% keywords: georectification
  26. #% keywords: GCP
  27. #%end
  28. """
  29. Module to run GCP management tool as stadalone application.
  30. @author Vaclav Petras <wenzeslaus gmail.com> (standalone module)
  31. """
  32. import os
  33. import wx
  34. import grass.script as grass
  35. from core.settings import UserSettings
  36. from core.globalvar import CheckWxVersion
  37. from core.giface import StandaloneGrassInterface
  38. from core.utils import GuiModuleMain
  39. from gcp.manager import GCPWizard
  40. def main():
  41. """Sets the GRASS display driver
  42. .. todo::
  43. use command line options as an alternative to wizard
  44. """
  45. driver = UserSettings.Get(group='display', key='driver', subkey='type')
  46. if driver == 'png':
  47. os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
  48. else:
  49. os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
  50. app = wx.App()
  51. if not CheckWxVersion([2, 9]):
  52. wx.InitAllImageHandlers()
  53. wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface())
  54. app.MainLoop()
  55. if __name__ == '__main__':
  56. options, flags = grass.parser()
  57. GuiModuleMain(main)