mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-30 00:29:39 -05:00
separate otb provider into a plugin
This commit is contained in:
parent
50fad18493
commit
cfc093d0e9
@ -55,6 +55,7 @@ endif()
|
||||
add_subdirectory(processing)
|
||||
add_subdirectory(sagaprovider)
|
||||
add_subdirectory(grassprovider)
|
||||
add_subdirectory(otbprovider)
|
||||
add_subdirectory(MetaSearch)
|
||||
|
||||
PY_COMPILE(staged-plugins "${PYTHON_OUTPUT_DIRECTORY}/plugins")
|
||||
|
||||
4
python/plugins/otbprovider/CMakeLists.txt
Normal file
4
python/plugins/otbprovider/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
file(GLOB PY_FILES *.py)
|
||||
file(GLOB OTHER_FILES metadata.txt)
|
||||
|
||||
PLUGIN_INSTALL(otbprovider . ${PY_FILES} ${OTHER_FILES})
|
||||
@ -51,8 +51,8 @@ from qgis.core import (Qgis,
|
||||
QgsProviderRegistry)
|
||||
|
||||
from processing.core.parameters import getParameterFromString
|
||||
from processing.algs.otb.OtbChoiceWidget import OtbParameterChoice
|
||||
from processing.algs.otb.OtbUtils import OtbUtils
|
||||
from .OtbChoiceWidget import OtbParameterChoice
|
||||
from .OtbUtils import OtbUtils
|
||||
|
||||
|
||||
class OtbAlgorithm(QgsProcessingAlgorithm):
|
||||
@ -35,8 +35,8 @@ from qgis.core import (Qgis,
|
||||
from qgis import utils
|
||||
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.algs.otb.OtbUtils import OtbUtils
|
||||
from processing.algs.otb.OtbAlgorithm import OtbAlgorithm
|
||||
from .OtbUtils import OtbUtils
|
||||
from .OtbAlgorithm import OtbAlgorithm
|
||||
|
||||
|
||||
class OtbAlgorithmProvider(QgsProcessingProvider):
|
||||
39
python/plugins/otbprovider/OtbProviderPlugin.py
Normal file
39
python/plugins/otbprovider/OtbProviderPlugin.py
Normal file
@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
OtbProviderPlugin.py
|
||||
---------------------
|
||||
Date : June 2021
|
||||
Copyright : (C) 2021 by Alexander Bruy
|
||||
Email : alexander dot bruy at gmail dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Alexander Bruy'
|
||||
__date__ = 'June 2021'
|
||||
__copyright__ = '(C) 2021, Alexander Bruy'
|
||||
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from otbprovider.OtbAlgorithmProvider import OtbAlgorithmProvider
|
||||
|
||||
|
||||
class OtbProviderPlugin:
|
||||
|
||||
def __init__(self):
|
||||
self.provider = OtbAlgorithmProvider()
|
||||
|
||||
def initGui(self):
|
||||
QgsApplication.processingRegistry().addProvider(self.provider)
|
||||
|
||||
def unload(self):
|
||||
QgsApplication.processingRegistry().removeProvider(self.provider)
|
||||
27
python/plugins/otbprovider/__init__.py
Normal file
27
python/plugins/otbprovider/__init__.py
Normal file
@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
__init__.py
|
||||
---------------------
|
||||
Date : June 2021
|
||||
Copyright : (C) 2021 by Alexander Bruy
|
||||
Email : alexander dot bruy at gmail dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Alexander Bruy'
|
||||
__date__ = 'June 2021'
|
||||
__copyright__ = '(C) 2021, Alexander Bruy'
|
||||
|
||||
|
||||
def classFactory(iface):
|
||||
from otbprovider.OtbProviderPlugin import OtbProviderPlugin
|
||||
return OtbProviderPlugin()
|
||||
17
python/plugins/otbprovider/metadata.txt
Normal file
17
python/plugins/otbprovider/metadata.txt
Normal file
@ -0,0 +1,17 @@
|
||||
[general]
|
||||
name=OrfeoToolbox provider
|
||||
description=OrfeoToolbox Processing provider
|
||||
about=OrfeoToolbox Processing provider
|
||||
category=Analysis
|
||||
version=2.12.99
|
||||
qgisMinimumVersion=3.0
|
||||
|
||||
author=Victor Olaya
|
||||
|
||||
icon=:/images/themes/default/providerOtb.svg
|
||||
|
||||
homepage=https://qgis.org
|
||||
tracker=https://github.com/qgis/QGIS/issues
|
||||
repository=https://github.com/qgis/QGIS
|
||||
|
||||
hasProcessingProvider=yes
|
||||
@ -2,7 +2,6 @@ file(GLOB PY_FILES *.py)
|
||||
|
||||
add_subdirectory(help)
|
||||
add_subdirectory(gdal)
|
||||
add_subdirectory(otb)
|
||||
add_subdirectory(qgis)
|
||||
|
||||
PLUGIN_INSTALL(processing algs ${PY_FILES})
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
file(GLOB PY_FILES *.py)
|
||||
PLUGIN_INSTALL(processing algs/otb ${PY_FILES})
|
||||
@ -59,9 +59,6 @@ with QgsRuntimeProfiler.profile('Import QGIS Provider'):
|
||||
with QgsRuntimeProfiler.profile('Import GDAL Provider'):
|
||||
from processing.algs.gdal.GdalAlgorithmProvider import GdalAlgorithmProvider # NOQA
|
||||
|
||||
with QgsRuntimeProfiler.profile('Import OTB Provider'):
|
||||
from processing.algs.otb.OtbAlgorithmProvider import OtbAlgorithmProvider # NOQA
|
||||
|
||||
with QgsRuntimeProfiler.profile('Import Script Provider'):
|
||||
from processing.script.ScriptAlgorithmProvider import ScriptAlgorithmProvider # NOQA
|
||||
|
||||
@ -112,7 +109,6 @@ class Processing(object):
|
||||
for c in [
|
||||
QgisAlgorithmProvider,
|
||||
GdalAlgorithmProvider,
|
||||
OtbAlgorithmProvider,
|
||||
ScriptAlgorithmProvider,
|
||||
ModelerAlgorithmProvider,
|
||||
ProjectProvider
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user