OtbProviderPlugin.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. ***************************************************************************
  3. OtbProviderPlugin.py
  4. ---------------------
  5. Date : June 2021
  6. Copyright : (C) 2021 by Alexander Bruy
  7. Email : alexander dot bruy at gmail dot com
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Alexander Bruy'
  18. __date__ = 'June 2021'
  19. __copyright__ = '(C) 2021, Alexander Bruy'
  20. from qgis.core import QgsApplication, QgsRuntimeProfiler
  21. with QgsRuntimeProfiler.profile('Import OTB Provider'):
  22. from otbprovider.OtbAlgorithmProvider import OtbAlgorithmProvider
  23. class OtbProviderPlugin:
  24. def __init__(self):
  25. self.provider = OtbAlgorithmProvider()
  26. def initProcessing(self):
  27. QgsApplication.processingRegistry().addProvider(self.provider)
  28. def initGui(self):
  29. self.initProcessing()
  30. def unload(self):
  31. QgsApplication.processingRegistry().removeProvider(self.provider)