def initAlgorithm(self, config=None):
        """ Virtual override

            see https://qgis.org/api/classQgsProcessingAlgorithm.html
        """
        param = QgsProcessingParameterFileDestination(self.OUTPUT, 'JSON file',
                                                      'JSON Files (*.json)')
        param.setMetadata({'wps:as_reference': True})

        self.addParameter(param)
Exemple #2
0
    def initAlgorithm(self, config=None):

        self.addParameter(
            QgsProcessingParameterNumber(
                self.POWER,
                'Power',
                type=QgsProcessingParameterNumber.Integer,
                defaultValue=2,
                minValue=2))

        # Add an file to return a response in JSON format
        json_param = QgsProcessingParameterFileDestination(
            self.OUTPUT_JSON_FILE, self.tr('JSON file'),
            self.tr('JSON Files (*.json)'))
        json_param.setMetadata({'plotly': True})
        self.addParameter(json_param)