示例#1
0
    def initAlgorithm(self, config):
        """
        Here we define the inputs and output of the algorithm, along
        with some other properties.
        """
        self.addParameter(
            QgsProcessingParameterFile(self.INPUT,
                                       self.tr('Input csv file'),
                                       extension='csv'))
        #  encoding of input file
        encParam = QgsProcessingParameterEnum(
            self.ENCODING, self.tr('select encoding of the file'))

        encParam.setOptions(self.encode)
        encParam.setAllowMultiple(False)
        encParam.setDefaultValue(QVariant('SJIS'))
        #  file encoding
        self.addParameter(encParam)

        #self.addParameter(self
        #)

        # We add a feature sink in which to store our processed features (this
        # usually takes the form of a newly created vector layer when the
        # algorithm is run in QGIS).
        self.addParameter(
            QgsProcessingParameterFeatureSink(self.OUTPUT,
                                              self.tr('Output layer')))
示例#2
0
    def initAlgorithm(self, config):

        # las file
        lasParam = QgsProcessingParameterFile(self.INPUT)
        lasParam.setDescription(self.tr('LAS file'))
        #lasParam.setExtension( 'las' )

        self.addParameter(lasParam)

        # database
        pgBaseParam = QgsProcessingParameterEnum(self.OUTPUT_BASE)
        pgBaseParam.setDescription(self.tr('PgPointCloud database'))
        pgBaseParam.setOptions(self.pgpointcloudDatabases())

        self.addParameter(pgBaseParam)

        # table
        pgTableParam = QgsProcessingParameterString(self.OUTPUT_TABLE)
        pgTableParam.setDescription(self.tr('PgPointCloud table'))

        self.addParameter(pgTableParam)

        # table
        layerParam = QgsProcessingParameterFeatureSink(self.OUTPUT_LAYER)
        layerParam.setDescription(self.tr('Vector layer'))

        self.addParameter(layerParam)