November 2018
Beginner to intermediate
272 pages
5h 36m
English
It is more likely that you will wish to extend your scripts to include multiple processing and potential multiple inputs and outputs. In this example, we will build on the buffer example and convert this result back to centroids. The following is the new code:
import processingfrom qgis.PyQt.QtCore import QCoreApplicationfrom qgis.core import QgsProcessingAlgorithm, QgsProcessing, QgsProcessingParameterFeatureSink,QgsProcessingParameterFeatureSourceclass testAlg(QgsProcessingAlgorithm): OUTPUT = 'OUTPUT' INPUT = 'INPUT' def tr(self, text): return QCoreApplication.translate('testalg', text) def createInstance(self): return type(self)() def group(self): return self.tr('Test') def groupId(self): return 'test' def __init__(self): ...Read now
Unlock full access