g.gui.gcp.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 managing Ground Control Points.
  22. #% keyword: general
  23. #% keyword: GUI
  24. #% keyword: georectification
  25. #% keyword: GCP
  26. #%end
  27. """
  28. Module to run GCP management tool as stadalone application.
  29. @author Vaclav Petras <wenzeslaus gmail.com> (standalone module)
  30. """
  31. import os
  32. import grass.script as gscript
  33. def main():
  34. """Sets the GRASS display driver
  35. .. todo::
  36. use command line options as an alternative to wizard
  37. """
  38. options, flags = gscript.parser()
  39. import wx
  40. from core.settings import UserSettings
  41. from core.globalvar import CheckWxVersion
  42. from core.giface import StandaloneGrassInterface
  43. from gcp.manager import GCPWizard
  44. driver = UserSettings.Get(group='display', key='driver', subkey='type')
  45. if driver == 'png':
  46. os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
  47. else:
  48. os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
  49. app = wx.App()
  50. if not CheckWxVersion([2, 9]):
  51. wx.InitAllImageHandlers()
  52. wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface())
  53. app.MainLoop()
  54. if __name__ == '__main__':
  55. main()