def initAlgorithm(self, config): self.addParameter( QgsProcessingParameterFeatureSource( self.PrmInputLayer, tr('Input point layer'), [QgsProcessing.TypeVectorPoint])) self.addParameter( QgsProcessingParameterEnum(self.PrmShapeType, tr('Shape type'), options=SHAPE_TYPE, defaultValue=0, optional=False)) self.addParameter( QgsProcessingParameterEnum( self.PrmAzimuthMode, tr('Azimuth mode'), options=[ tr('Use beginning and ending azimuths'), tr('Use center azimuth and width') ], defaultValue=1, optional=False)) self.addParameter( QgsProcessingParameterField( self.PrmAzimuth1Field, tr('Starting azimuth field / Center azimuth field'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmAzimuth2Field, tr('Ending azimuth field / Azimuth width field'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmRadiusField, tr('Radius field'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterEnum(self.PrmUnitsOfMeasure, tr('Radius units'), options=DISTANCE_LABELS, defaultValue=0, optional=False)) self.addParameter( QgsProcessingParameterNumber( self.PrmDefaultAzimuth1, tr('Default starting azimuth / Default center azimuth'), QgsProcessingParameterNumber.Double, defaultValue=0, optional=True)) self.addParameter( QgsProcessingParameterNumber( self.PrmDefaultAzimuth2, tr('Default ending azimuth / Default azimuth width'), QgsProcessingParameterNumber.Double, defaultValue=30.0, optional=True)) self.addParameter( QgsProcessingParameterNumber(self.PrmDefaultRadius, tr('Default radius'), QgsProcessingParameterNumber.Double, defaultValue=20.0, minValue=0, optional=True)) self.addParameter( QgsProcessingParameterNumber(self.PrmDrawingSegments, tr('Number of drawing segments'), QgsProcessingParameterNumber.Integer, defaultValue=36, minValue=4, optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.PrmExportInputGeometry, tr('Add input geometry fields to output table'), False, optional=True)) self.addParameter( QgsProcessingParameterFeatureSink(self.PrmOutputLayer, tr('Output layer')))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Point layer'), [QgsProcessing.TypeVectorPoint])) z_field_param = QgsProcessingParameterField( self.Z_FIELD, self.tr('Z value from field'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True) z_field_param.setFlags(z_field_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(z_field_param) self.addParameter( QgsProcessingParameterNumber( self.RADIUS_1, self.tr('The first radius of search ellipse'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.RADIUS_2, self.tr('The second radius of search ellipse'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.ANGLE, self. tr('Angle of search ellipse rotation in degrees (counter clockwise)' ), type=QgsProcessingParameterNumber.Double, minValue=0.0, maxValue=360.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.NODATA, self.tr('NODATA marker to fill empty points'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0)) options_param = QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True) options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) options_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.gdal.ui.RasterOptionsWidget.RasterOptionsWidgetWrapper' } }) self.addParameter(options_param) dataType_param = QgsProcessingParameterEnum( self.DATA_TYPE, self.tr('Output data type'), self.TYPES, allowMultiple=False, defaultValue=5) dataType_param.setFlags( dataType_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(dataType_param) self.addParameter( QgsProcessingParameterRasterDestination( self.OUTPUT, self.tr('Interpolated (Nearest neighbor)')))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterFeatureSource( self.MASK, self.tr('Mask layer'), [QgsProcessing.TypeVectorPolygon])) self.addParameter( QgsProcessingParameterNumber( self.NODATA, self.tr('Assign a specified nodata value to output bands'), type=QgsProcessingParameterNumber.Double, defaultValue=None, optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.ALPHA_BAND, self.tr('Create an output alpha band'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.CROP_TO_CUTLINE, self. tr('Match the extent of the clipped raster to the extent of the mask layer' ), defaultValue=True)) self.addParameter( QgsProcessingParameterBoolean( self.KEEP_RESOLUTION, self.tr('Keep resolution of output raster'), defaultValue=False)) options_param = QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True) options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) options_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.gdal.ui.RasterOptionsWidget.RasterOptionsWidgetWrapper' } }) self.addParameter(options_param) dataType_param = QgsProcessingParameterEnum( self.DATA_TYPE, self.tr('Output data type'), self.TYPES, allowMultiple=False, defaultValue=0) dataType_param.setFlags( dataType_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(dataType_param) self.addParameter( QgsProcessingParameterRasterDestination(self.OUTPUT, self.tr('Clipped (mask)')))
def initAlgorithm(self, config=None): self.predicates = (('intersects', self.tr('intersects')), ('contains', self.tr('contains')), ('isEqual', self.tr('equals')), ('touches', self.tr('touches')), ('overlaps', self.tr('overlaps')), ('within', self.tr('within')), ('crosses', self.tr('crosses'))) self.reversed_predicates = { 'intersects': 'intersects', 'contains': 'within', 'isEqual': 'isEqual', 'touches': 'touches', 'overlaps': 'overlaps', 'within': 'contains', 'crosses': 'crosses' } self.methods = [ self. tr('Create separate feature for each located feature (one-to-many)' ), self. tr('Take attributes of the first located feature only (one-to-one)' ) ] self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Input layer'), [QgsProcessing.TypeVectorAnyGeometry])) self.addParameter( QgsProcessingParameterFeatureSource( self.JOIN, self.tr('Join layer'), [QgsProcessing.TypeVectorAnyGeometry])) predicate = QgsProcessingParameterEnum( self.PREDICATE, self.tr('Geometric predicate'), options=[p[1] for p in self.predicates], allowMultiple=True, defaultValue=[0]) predicate.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers.EnumWidgetWrapper', 'useCheckBoxes': True, 'columns': 2 } }) self.addParameter(predicate) self.addParameter( QgsProcessingParameterField( self.JOIN_FIELDS, self.tr('Fields to add (leave empty to use all fields)'), parentLayerParameterName=self.JOIN, allowMultiple=True, optional=True)) self.addParameter( QgsProcessingParameterEnum(self.METHOD, self.tr('Join type'), self.methods)) self.addParameter( QgsProcessingParameterBoolean( self.DISCARD_NONMATCHING, self.tr('Discard records which could not be joined'), defaultValue=False)) self.addParameter( QgsProcessingParameterString(self.PREFIX, self.tr('Joined field prefix'), optional=True)) self.addParameter( QgsProcessingParameterFeatureSink( self.OUTPUT, self.tr('Joined layer'), QgsProcessing.TypeVectorAnyGeometry, defaultValue=None, optional=True, createByDefault=True)) non_matching = QgsProcessingParameterFeatureSink( self.NON_MATCHING, self.tr('Unjoinable features from first layer'), QgsProcessing.TypeVectorAnyGeometry, defaultValue=None, optional=True, createByDefault=False) # TODO GUI doesn't support advanced outputs yet # non_matching.setFlags(non_matching.flags() | QgsProcessingParameterDefinition.FlagAdvanced ) self.addParameter(non_matching) self.addOutput( QgsProcessingOutputNumber( self.JOINED_COUNT, self.tr("Number of joined features from input table")))
def initAlgorithm(self, config=None): self.units = [self.tr("Pixels"), self.tr("Georeferenced units")] self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterField( self.FIELD, self.tr('Field to use for a burn-in value'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True)) self.addParameter( QgsProcessingParameterNumber( self.BURN, self.tr('A fixed value to burn'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0, optional=True)) self.addParameter( QgsProcessingParameterEnum(self.UNITS, self.tr('Output raster size units'), self.units)) self.addParameter( QgsProcessingParameterNumber( self.WIDTH, self.tr('Width/Horizontal resolution'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.HEIGHT, self.tr('Height/Vertical resolution'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterExtent(self.EXTENT, self.tr('Output extent'))) self.addParameter( QgsProcessingParameterNumber( self.NODATA, self.tr('Assign a specified nodata value to output bands'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0, optional=True)) options_param = QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation parameters'), defaultValue='', optional=True) options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) options_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.gdal.ui.RasterOptionsWidget.RasterOptionsWidgetWrapper' } }) self.addParameter(options_param) dataType_param = QgsProcessingParameterEnum( self.DATA_TYPE, self.tr('Output data type'), self.TYPES, allowMultiple=False, defaultValue=5) dataType_param.setFlags( dataType_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(dataType_param) init_param = QgsProcessingParameterNumber( self.INIT, self.tr('Pre-initialize the output image with value'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0, optional=True) init_param.setFlags(init_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(init_param) invert_param = QgsProcessingParameterBoolean( self.INVERT, self.tr('Invert rasterization'), defaultValue=False) invert_param.setFlags(invert_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(invert_param) self.addParameter( QgsProcessingParameterRasterDestination(self.OUTPUT, self.tr('Rasterized')))
def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT_RASTER, self.tr('Raster layer'))) self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT_VECTOR, self.tr('Vector layer'), [QgsProcessing.TypeVectorPolygon])) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Points inside polygons'), QgsProcessing.TypeVectorPoint))
def initAlgorithm(self, config=None): self.predicates = (('intersects', self.tr('intersects')), ('contains', self.tr('contains')), ('equals', self.tr('equals')), ('touches', self.tr('touches')), ('overlaps', self.tr('overlaps')), ('within', self.tr('within')), ('crosses', self.tr('crosses'))) self.statistics = [('count', self.tr('count')), ('unique', self.tr('unique')), ('min', self.tr('min')), ('max', self.tr('max')), ('range', self.tr('range')), ('sum', self.tr('sum')), ('mean', self.tr('mean')), ('median', self.tr('median')), ('stddev', self.tr('stddev')), ('minority', self.tr('minority')), ('majority', self.tr('majority')), ('q1', self.tr('q1')), ('q3', self.tr('q3')), ('iqr', self.tr('iqr')), ('empty', self.tr('empty')), ('filled', self.tr('filled')), ('min_length', self.tr('min_length')), ('max_length', self.tr('max_length')), ('mean_length', self.tr('mean_length'))] self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Input layer'), [QgsProcessing.TypeVectorAnyGeometry])) self.addParameter( QgsProcessingParameterFeatureSource( self.JOIN, self.tr('Join layer'), [QgsProcessing.TypeVectorAnyGeometry])) predicate = QgsProcessingParameterEnum( self.PREDICATE, self.tr('Geometric predicate'), options=[p[1] for p in self.predicates], allowMultiple=True, defaultValue=[0]) predicate.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers.EnumWidgetWrapper', 'useCheckBoxes': True, 'columns': 2 } }) self.addParameter(predicate) self.addParameter( QgsProcessingParameterField( self.JOIN_FIELDS, self.tr('Fields to summarise (leave empty to use all fields)'), parentLayerParameterName=self.JOIN, allowMultiple=True, optional=True)) self.addParameter( QgsProcessingParameterEnum( self.SUMMARIES, self.tr( 'Summaries to calculate (leave empty to use all available)' ), options=[p[1] for p in self.statistics], allowMultiple=True, optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.DISCARD_NONMATCHING, self.tr('Discard records which could not be joined'), defaultValue=False)) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Joined layer')))
def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter(QgsProcessingParameterEnum(self.METHOD, self.tr('Calculate using'), options=self.calc_methods, defaultValue=0)) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Added geom info')))
def initAlgorithm(self, config=None): self.metrics = ((self.tr('Minimum'), 'minimum'), (self.tr('Maximum'), 'maximum'), (self.tr('Range'), 'range'), (self.tr('Count'), 'count'), (self.tr('Average distance'), 'average_distance'), (self.tr('Average distance between points'), 'average_distance_pts')) self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Point layer'), [QgsProcessing.TypeVectorPoint])) z_field_param = QgsProcessingParameterField( self.Z_FIELD, self.tr('Z value from field'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True) z_field_param.setFlags(z_field_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(z_field_param) self.addParameter( QgsProcessingParameterEnum(self.METRIC, self.tr('Data metric to use'), options=[i[0] for i in self.metrics], allowMultiple=False, defaultValue=0)) self.addParameter( QgsProcessingParameterNumber( self.RADIUS_1, self.tr('The first radius of search ellipse'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.RADIUS_2, self.tr('The second radius of search ellipse'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.ANGLE, self. tr('Angle of search ellipse rotation in degrees (counter clockwise)' ), type=QgsProcessingParameterNumber.Double, minValue=0.0, maxValue=360.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.MIN_POINTS, self.tr('Minimum number of data points to use'), type=QgsProcessingParameterNumber.Integer, minValue=0, defaultValue=0)) self.addParameter( QgsProcessingParameterNumber( self.NODATA, self.tr('NODATA marker to fill empty points'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0)) options_param = QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation parameters'), defaultValue='', optional=True) options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) options_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.gdal.ui.RasterOptionsWidget.RasterOptionsWidgetWrapper' } }) self.addParameter(options_param) dataType_param = QgsProcessingParameterEnum( self.DATA_TYPE, self.tr('Output data type'), self.TYPES, allowMultiple=False, defaultValue=5) dataType_param.setFlags( dataType_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(dataType_param) self.addParameter( QgsProcessingParameterRasterDestination( self.OUTPUT, self.tr('Interpolated (data metrics)')))
def initAlgorithm(self, config=None): self.DIRECTIONS = OrderedDict([ (self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward), (self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward), (self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth) ]) self.STRATEGIES = [ self.tr('Shortest distance'), self.tr('Fastest time') ] self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Network Layer'), [QgsProcessing.TypeVectorLine])) self.addParameter( QgsProcessingParameterFeatureSource( self.START_POINTS, self.tr('Startpoint Layer'), [QgsProcessing.TypeVectorPoint])) self.addParameter( QgsProcessingParameterField(self.ID_FIELD, self.tr('Unique Point ID Field'), None, self.START_POINTS, optional=False)) self.addParameter( QgsProcessingParameterNumber( self.MAX_DIST, self. tr('Size of Iso-Area (Distance or Seconds depending on Strategy)' ), QgsProcessingParameterNumber.Double, 2500.0, False, 0, 99999999.99)) self.addParameter( QgsProcessingParameterEnum(self.STRATEGY, self.tr('Path type to calculate'), self.STRATEGIES, defaultValue=0)) params = [] params.append( QgsProcessingParameterField(self.DIRECTION_FIELD, self.tr('Direction field'), None, self.INPUT, optional=True)) params.append( QgsProcessingParameterString( self.VALUE_FORWARD, self.tr('Value for forward direction'), optional=True)) params.append( QgsProcessingParameterString( self.VALUE_BACKWARD, self.tr('Value for backward direction'), optional=True)) params.append( QgsProcessingParameterString(self.VALUE_BOTH, self.tr('Value for both directions'), optional=True)) params.append( QgsProcessingParameterEnum(self.DEFAULT_DIRECTION, self.tr('Default direction'), list(self.DIRECTIONS.keys()), defaultValue=2)) params.append( QgsProcessingParameterField(self.SPEED_FIELD, self.tr('Speed field (km/h)'), None, self.INPUT, optional=True)) params.append( QgsProcessingParameterNumber(self.DEFAULT_SPEED, self.tr('Default speed (km/h)'), QgsProcessingParameterNumber.Double, 5.0, False, 0, 99999999.99)) params.append( QgsProcessingParameterNumber(self.TOLERANCE, self.tr('Topology tolerance'), QgsProcessingParameterNumber.Double, 0.00001, False, 0, 99999999.99)) for p in params: p.setFlags(p.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(p) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Output Pointcloud'), QgsProcessing.TypeVectorPoint))
def initAlgorithm(self, config=None): self.predicates = (('intersects', self.tr('intersects')), ('contains', self.tr('contains')), ('equals', self.tr('equals')), ('touches', self.tr('touches')), ('overlaps', self.tr('overlaps')), ('within', self.tr('within')), ('crosses', self.tr('crosses'))) self.reversed_predicates = { 'intersects': 'intersects', 'contains': 'within', 'isEqual': 'isEqual', 'touches': 'touches', 'overlaps': 'overlaps', 'within': 'contains', 'crosses': 'crosses' } self.methods = [ self.tr('Create separate feature for each located feature'), self.tr('Take attributes of the first located feature only') ] self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Input layer'), [QgsProcessing.TypeVectorAnyGeometry])) self.addParameter( QgsProcessingParameterFeatureSource( self.JOIN, self.tr('Join layer'), [QgsProcessing.TypeVectorAnyGeometry])) predicate = QgsProcessingParameterEnum( self.PREDICATE, self.tr('Geometric predicate'), options=[p[1] for p in self.predicates], allowMultiple=True, defaultValue=[0]) predicate.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers.EnumWidgetWrapper', 'useCheckBoxes': True, 'columns': 2 } }) self.addParameter(predicate) self.addParameter( QgsProcessingParameterField( self.JOIN_FIELDS, self.tr('Fields to add (leave empty to use all fields)'), parentLayerParameterName=self.JOIN, allowMultiple=True, optional=True)) self.addParameter( QgsProcessingParameterEnum(self.METHOD, self.tr('Join type'), self.methods)) self.addParameter( QgsProcessingParameterBoolean( self.DISCARD_NONMATCHING, self.tr('Discard records which could not be joined'), defaultValue=False)) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Joined layer')))
def initAlgorithm(self, config=None): """ Here we define the inputs and output of the algorithm, along with some other properties. """ # We add the point input vector features source #QgsProcessingFeatureSourceDefinition self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT_L, self.tr('Input sorgente dati'), [QgsProcessing.TypeMapLayer], "")) self.addParameter( QgsProcessingParameterField( self.INPUT_F, self.tr('Selezionare i campi da inserire nel file Html'), allowMultiple=True, defaultValue=[], parentLayerParameterName=self.INPUT_L)) self.addParameter( QgsProcessingParameterExpression( self.GROUP_BY, self.tr('Espressione filtro'), defaultValue=[], optional=True, parentLayerParameterName=self.INPUT_L)) self.addParameter( QgsProcessingParameterExpression( self.INPUT_T, self.tr('Titolo pagina'), defaultValue=[], optional=True, parentLayerParameterName=self.INPUT_L)) # We add the input icon source self.addParameter( QgsProcessingParameterFile( self.INPUT_I, 'Icona Gruppo', behavior=QgsProcessingParameterFile.File, fileFilter='Image file (*.gif; *.jpeg; *.jpg; *.png; *.svg)', defaultValue='', optional=True)) # We add the input css self.addParameter( QgsProcessingParameterFile( self.INPUT_S, 'Foglio di stile CSS', behavior=QgsProcessingParameterFile.File, fileFilter='Css file (*.css)', defaultValue="", optional=True)) self.addParameter( QgsProcessingParameterString( self.INPUT_D, 'Dimensioni icona Gruppo e foto [base x altezza in pt, px, mm, auto]', '25px; 25px; auto; 10%')) # We add a file output of type HTML self.addParameter( QgsProcessingParameterFileDestination( self.OUTPUT, self.tr('Tabella HTML'), 'HTML files (*.html)', )) self.addParameter( QgsProcessingParameterBoolean(self.INPUT_ABS, 'Percorsi file relativi', 0))
def okPressed(self): description = str(self.nameTextBox.text()) if description.strip() == '': QMessageBox.warning(self, self.tr('Unable to define parameter'), self.tr('Invalid parameter name')) return if self.param is None: validChars = \ 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' safeName = ''.join(c for c in description if c in validChars) name = safeName.lower() i = 2 while self.alg.parameterDefinition(name): name = safeName.lower() + str(i) i += 1 else: name = self.param.name() if (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_BOOLEAN or isinstance(self.param, QgsProcessingParameterBoolean)): self.param = QgsProcessingParameterBoolean(name, description, self.state.isChecked()) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_TABLE_FIELD or isinstance(self.param, QgsProcessingParameterField)): if self.parentCombo.currentIndex() < 0: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return parent = self.parentCombo.currentData() datatype = self.datatypeCombo.currentData() self.param = QgsProcessingParameterField( name, description, None, parent, datatype, self.multipleCheck.isChecked()) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_BAND or isinstance(self.param, QgsProcessingParameterBand)): if self.parentCombo.currentIndex() < 0: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return parent = self.parentCombo.currentData() self.param = QgsProcessingParameterBand(name, description, None, parent) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_RASTER or isinstance(self.param, QgsProcessingParameterRasterLayer)): self.param = QgsProcessingParameterRasterLayer(name, description) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_TABLE or isinstance(self.param, QgsProcessingParameterVectorLayer)): self.param = QgsProcessingParameterVectorLayer(name, description) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_VECTOR or isinstance(self.param, QgsProcessingParameterFeatureSource)): self.param = QgsProcessingParameterFeatureSource( name, description, [self.shapetypeCombo.currentIndex() - 1]) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_MULTIPLE or isinstance(self.param, QgsProcessingParameterMultipleLayers)): self.param = QgsProcessingParameterMultipleLayers( name, description, self.datatypeCombo.currentIndex() - 1) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_NUMBER or isinstance(self.param, QgsProcessingParameterNumber)): try: self.param = QgsProcessingParameterNumber( name, description, QgsProcessingParameterNumber.Double, self.defaultTextBox.text()) vmin = self.minTextBox.text().strip() if not vmin == '': self.param.setMinimum(float(vmin)) vmax = self.maxTextBox.text().strip() if not vmax == '': self.param.setMaximum(float(vmax)) except: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_EXPRESSION or isinstance(self.param, QgsProcessingParameterExpression)): parent = self.parentCombo.currentData() self.param = QgsProcessingParameterExpression( name, description, str(self.defaultEdit.expression()), parent) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_STRING or isinstance(self.param, QgsProcessingParameterString)): self.param = QgsProcessingParameterString( name, description, str(self.defaultTextBox.text())) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_EXTENT or isinstance(self.param, QgsProcessingParameterExtent)): self.param = QgsProcessingParameterExtent(name, description) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_FILE or isinstance(self.param, QgsProcessingParameterFile)): isFolder = self.fileFolderCombo.currentIndex() == 1 self.param = QgsProcessingParameterFile( name, description, QgsProcessingParameterFile.Folder if isFolder else QgsProcessingParameterFile.File) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_POINT or isinstance(self.param, QgsProcessingParameterPoint)): self.param = QgsProcessingParameterPoint( name, description, str(self.defaultTextBox.text())) elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_CRS or isinstance(self.param, QgsProcessingParameterCrs)): self.param = QgsProcessingParameterCrs( name, description, self.selector.crs().authid()) if not self.requiredCheck.isChecked(): self.param.setFlags( self.param.flags() | QgsProcessingParameterDefinition.FlagOptional) self.close()
def initAlgorithm(self, config): self.addParameter( QgsProcessingParameterFeatureSource( self.PrmInputLayer, tr('Input layer'), [QgsProcessing.TypeFile | QgsProcessing.TypeVectorPoint])) self.addParameter( QgsProcessingParameterCrs( self.PrmInputCRS, tr('Input CRS for coordinates within the vector fields'), 'EPSG:4326')) self.addParameter( QgsProcessingParameterCrs(self.PrmOutputCRS, tr('Output layer CRS'), 'EPSG:4326')) self.addParameter( QgsProcessingParameterEnum(self.PrmLineType, tr('Line type'), options=self.LINE_TYPE, defaultValue=0, optional=False)) self.addParameter( QgsProcessingParameterBoolean( self.PrmStartUseLayerGeom, tr('Use the point geometry for the line starting point'), False, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmStartXField, tr('Starting X Field (lon)'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmStartYField, tr('Starting Y Field (lat)'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.PrmEndUseLayerGeom, tr('Use the point geometry for the line ending point'), False, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmEndXField, tr('Ending X Field (lon)'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterField( self.PrmEndYField, tr('Ending Y Field (lat)'), parentLayerParameterName=self.PrmInputLayer, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterBoolean(self.PrmShowStartPoint, tr('Show starting point'), True, optional=True)) self.addParameter( QgsProcessingParameterBoolean(self.PrmShowEndPoint, tr('Show ending point'), True, optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.PrmDateLineBreak, tr('Break lines at -180, 180 boundary for better rendering'), False, optional=True)) self.addParameter( QgsProcessingParameterFeatureSink(self.PrmOutputLineLayer, tr('Output line layer'))) self.addParameter( QgsProcessingParameterFeatureSink(self.PrmOutputPointLayer, tr('Output point layer'), optional=True, createByDefault=True))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Cleaned')))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterExpression( self.GROUP_BY, self.tr('Group by expression (NULL to group all features)'), defaultValue='NULL', optional=False, parentLayerParameterName=self.INPUT)) class ParameterAggregates(QgsProcessingParameterDefinition): def __init__(self, name, description, parentLayerParameterName='INPUT'): super().__init__(name, description) self._parentLayerParameter = parentLayerParameterName def clone(self): copy = ParameterAggregates(self.name(), self.description(), self._parentLayerParameter) return copy def type(self): return 'aggregates' def checkValueIsAcceptable(self, value, context=None): if not isinstance(value, list): return False for field_def in value: if not isinstance(field_def, dict): return False if not field_def.get('input', False): return False if not field_def.get('aggregate', False): return False if not field_def.get('name', False): return False if not field_def.get('type', False): return False return True def valueAsPythonString(self, value, context): return str(value) def asScriptCode(self): raise NotImplementedError() @classmethod def fromScriptCode(cls, name, description, isOptional, definition): raise NotImplementedError() def parentLayerParameter(self): return self._parentLayerParameter self.addParameter( ParameterAggregates(self.AGGREGATES, description=self.tr('Aggregates'))) self.parameterDefinition(self.AGGREGATES).setMetadata({ 'widget_wrapper': 'processing.algs.qgis.ui.AggregatesPanel.AggregatesWidgetWrapper' }) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Aggregated')))
def initAlgorithm(self, config=None): self.DIRECTIONS = OrderedDict([ (self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward), (self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward), (self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)]) self.STRATEGIES = [self.tr('Shortest'), self.tr('Fastest') ] self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Vector layer representing network'), [QgsProcessing.TypeVectorLine])) self.addParameter(QgsProcessingParameterFeatureSource(self.START_POINTS, self.tr('Vector layer with start points'), [QgsProcessing.TypeVectorPoint])) self.addParameter(QgsProcessingParameterEnum(self.STRATEGY, self.tr('Path type to calculate'), self.STRATEGIES, defaultValue=0)) self.addParameter(QgsProcessingParameterNumber(self.TRAVEL_COST, self.tr('Travel cost (distance for "Shortest", time for "Fastest")'), QgsProcessingParameterNumber.Double, 0.0, False, 0)) params = [] params.append(QgsProcessingParameterField(self.DIRECTION_FIELD, self.tr('Direction field'), None, self.INPUT, optional=True)) params.append(QgsProcessingParameterString(self.VALUE_FORWARD, self.tr('Value for forward direction'), optional=True)) params.append(QgsProcessingParameterString(self.VALUE_BACKWARD, self.tr('Value for backward direction'), optional=True)) params.append(QgsProcessingParameterString(self.VALUE_BOTH, self.tr('Value for both directions'), optional=True)) params.append(QgsProcessingParameterEnum(self.DEFAULT_DIRECTION, self.tr('Default direction'), list(self.DIRECTIONS.keys()), defaultValue=2)) params.append(QgsProcessingParameterField(self.SPEED_FIELD, self.tr('Speed field'), None, self.INPUT, optional=True)) params.append(QgsProcessingParameterNumber(self.DEFAULT_SPEED, self.tr('Default speed (km/h)'), QgsProcessingParameterNumber.Double, 5.0, False, 0)) params.append(QgsProcessingParameterDistance(self.TOLERANCE, self.tr('Topology tolerance'), 0.0, self.INPUT, False, 0)) params.append(QgsProcessingParameterBoolean(self.INCLUDE_BOUNDS, self.tr('Include upper/lower bound points'), defaultValue=False)) for p in params: p.setFlags(p.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(p) lines_output = QgsProcessingParameterFeatureSink(self.OUTPUT_LINES, self.tr('Service area (lines)'), QgsProcessing.TypeVectorLine, optional=True) lines_output.setCreateByDefault(True) self.addParameter(lines_output) nodes_output = QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Service area (boundary nodes)'), QgsProcessing.TypeVectorPoint, optional=True) nodes_output.setCreateByDefault(False) self.addParameter(nodes_output)
def initAlgorithm(self, config=None): self.KERNELS = OrderedDict([(self.tr('Quartic'), QgsKernelDensityEstimation.KernelQuartic), (self.tr('Triangular'), QgsKernelDensityEstimation.KernelTriangular), (self.tr('Uniform'), QgsKernelDensityEstimation.KernelUniform), (self.tr('Triweight'), QgsKernelDensityEstimation.KernelTriweight), (self.tr('Epanechnikov'), QgsKernelDensityEstimation.KernelEpanechnikov)]) self.OUTPUT_VALUES = OrderedDict([(self.tr('Raw'), QgsKernelDensityEstimation.OutputRaw), (self.tr('Scaled'), QgsKernelDensityEstimation.OutputScaled)]) self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Point layer'), [QgsProcessing.TypeVectorPoint])) self.addParameter(QgsProcessingParameterNumber(self.RADIUS, self.tr('Radius (layer units)'), QgsProcessingParameterNumber.Double, 100.0, False, 0.0, 9999999999.99)) radius_field_param = QgsProcessingParameterField(self.RADIUS_FIELD, self.tr('Radius from field'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True ) radius_field_param.setFlags(radius_field_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(radius_field_param) class ParameterHeatmapPixelSize(QgsProcessingParameterNumber): def __init__(self, name='', description='', parent_layer=None, radius_param=None, radius_field_param=None, minValue=None, maxValue=None, default=None, optional=False): QgsProcessingParameterNumber.__init__(self, name, description, QgsProcessingParameterNumber.Double, default, optional, minValue, maxValue) self.parent_layer = parent_layer self.radius_param = radius_param self.radius_field_param = radius_field_param def clone(self): copy = ParameterHeatmapPixelSize(self.name(), self.description(), self.parent_layer, self.radius_param, self.radius_field_param, self.minimum(), self.maximum(), self.defaultValue((), self.flags() & QgsProcessingParameterDefinition.FlagOptional)) return copy pixel_size_param = ParameterHeatmapPixelSize(self.PIXEL_SIZE, self.tr('Output raster size'), parent_layer=self.INPUT, radius_param=self.RADIUS, radius_field_param=self.RADIUS_FIELD, minValue=0.0, maxValue=9999999999, default=0.1) pixel_size_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.qgis.ui.HeatmapWidgets.HeatmapPixelSizeWidgetWrapper'}}) self.addParameter(pixel_size_param) weight_field_param = QgsProcessingParameterField(self.WEIGHT_FIELD, self.tr('Weight from field'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True ) weight_field_param.setFlags(weight_field_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(weight_field_param) keys = list(self.KERNELS.keys()) kernel_shape_param = QgsProcessingParameterEnum(self.KERNEL, self.tr('Kernel shape'), keys, allowMultiple=False, defaultValue=0) kernel_shape_param.setFlags(kernel_shape_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(kernel_shape_param) decay_ratio = QgsProcessingParameterNumber(self.DECAY, self.tr('Decay ratio (Triangular kernels only)'), QgsProcessingParameterNumber.Double, 0.0, True, -100.0, 100.0) decay_ratio.setFlags(decay_ratio.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(decay_ratio) keys = list(self.OUTPUT_VALUES.keys()) output_scaling = QgsProcessingParameterEnum(self.OUTPUT_VALUE, self.tr('Output value scaling'), keys, allowMultiple=False, defaultValue=0) output_scaling.setFlags(output_scaling.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(output_scaling) self.addParameter(QgsProcessingParameterRasterDestination(self.OUTPUT, self.tr('Heatmap')))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource( self.INPUT, self.tr('Point layer'), [QgsProcessing.TypeVectorPoint])) z_field_param = QgsProcessingParameterField( self.Z_FIELD, self.tr('Z value from field'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True) z_field_param.setFlags(z_field_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(z_field_param) self.addParameter( QgsProcessingParameterNumber( self.POWER, self.tr('Weighting power'), type=QgsProcessingParameterNumber.Double, minValue=0.0, maxValue=100.0, defaultValue=2.0)) self.addParameter( QgsProcessingParameterNumber( self.SMOOTHING, self.tr('Smoothing'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=0.0)) self.addParameter( QgsProcessingParameterNumber( self.RADIUS, self.tr('The radius of the search circle'), type=QgsProcessingParameterNumber.Double, minValue=0.0, defaultValue=1.0)) self.addParameter( QgsProcessingParameterNumber( self.MAX_POINTS, self.tr('Maximum number of data points to use'), type=QgsProcessingParameterNumber.Integer, minValue=0, defaultValue=12)) self.addParameter( QgsProcessingParameterNumber( self.MIN_POINTS, self.tr('Minimum number of data points to use'), type=QgsProcessingParameterNumber.Integer, minValue=0, defaultValue=0)) self.addParameter( QgsProcessingParameterNumber( self.NODATA, self.tr('NODATA marker to fill empty points'), type=QgsProcessingParameterNumber.Double, defaultValue=0.0)) options_param = QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True) options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) options_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.algs.gdal.ui.RasterOptionsWidget.RasterOptionsWidgetWrapper' } }) self.addParameter(options_param) dataType_param = QgsProcessingParameterEnum( self.DATA_TYPE, self.tr('Output data type'), self.TYPES, allowMultiple=False, defaultValue=5) dataType_param.setFlags( dataType_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(dataType_param) self.addParameter( QgsProcessingParameterRasterDestination( self.OUTPUT, self.tr('Interpolated (IDW with NN search)')))
def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'), types=[QgsProcessing.TypeVectorLine])) self.addParameter(QgsProcessingParameterBoolean(self.KEEP_FIELDS, self.tr('Keep table structure of line layer'), defaultValue=False, optional=True)) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Polygons from lines'), QgsProcessing.TypeVectorPolygon))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Layer to import'))) db_param = QgsProcessingParameterString( self.DATABASE, self.tr('Database (connection name)')) db_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.ConnectionWidgetWrapper' } }) self.addParameter(db_param) schema_param = QgsProcessingParameterString( self.SCHEMA, self.tr('Schema (schema name)'), 'public', False, True) schema_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.SchemaWidgetWrapper', 'connection_param': self.DATABASE } }) self.addParameter(schema_param) table_param = QgsProcessingParameterString( self.TABLENAME, self.tr('Table to import to (leave blank to use layer name)'), '', False, True) table_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.TableWidgetWrapper', 'schema_param': self.SCHEMA } }) self.addParameter(table_param) self.addParameter( QgsProcessingParameterField(self.PRIMARY_KEY, self.tr('Primary key field'), None, self.INPUT, QgsProcessingParameterField.Any, False, True)) self.addParameter( QgsProcessingParameterString(self.GEOMETRY_COLUMN, self.tr('Geometry column'), 'geom')) self.addParameter( QgsProcessingParameterString(self.ENCODING, self.tr('Encoding'), 'UTF-8', False, True)) self.addParameter( QgsProcessingParameterBoolean(self.OVERWRITE, self.tr('Overwrite'), True)) self.addParameter( QgsProcessingParameterBoolean(self.CREATEINDEX, self.tr('Create spatial index'), True)) self.addParameter( QgsProcessingParameterBoolean( self.LOWERCASE_NAMES, self.tr('Convert field names to lowercase'), True)) self.addParameter( QgsProcessingParameterBoolean( self.DROP_STRING_LENGTH, self.tr('Drop length constraints on character fields'), False)) self.addParameter( QgsProcessingParameterBoolean( self.FORCE_SINGLEPART, self.tr('Create single-part geometries instead of multi-part'), False))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterField(self.FIELD, self.tr('Dissolve field'), None, self.INPUT, QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterString(self.GEOMETRY, self.tr('Geometry column name'), defaultValue='geometry')) params = [] params.append( QgsProcessingParameterBoolean( self.EXPLODE_COLLECTIONS, self. tr('Produce one feature for each geometry in any kind of geometry collection in the source file' ), defaultValue=False)) params.append( QgsProcessingParameterBoolean(self.KEEP_ATTRIBUTES, self.tr('Keep input attributes'), defaultValue=False)) params.append( QgsProcessingParameterBoolean(self.COUNT_FEATURES, self.tr('Count dissolved features'), defaultValue=False)) params.append( QgsProcessingParameterBoolean( self.COMPUTE_AREA, self.tr('Compute area and perimeter of dissolved features'), defaultValue=False)) params.append( QgsProcessingParameterBoolean( self.COMPUTE_STATISTICS, self.tr('Compute min/max/sum/mean for attribute'), defaultValue=False)) params.append( QgsProcessingParameterField( self.STATISTICS_ATTRIBUTE, self.tr('Numeric attribute to calculate statistics on'), None, self.INPUT, QgsProcessingParameterField.Numeric, optional=True)) params.append( QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True)) for param in params: param.setFlags(param.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(param) self.addParameter( QgsProcessingParameterVectorDestination(self.OUTPUT, self.tr('Dissolved')))
def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'), [QgsProcessing.TypeVectorLine])) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Exploded'), QgsProcessing.TypeVectorLine))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT_LAYER, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterField( self.FIELD_NAME, self.tr('Field to calculate statistics on'), None, self.INPUT_LAYER, QgsProcessingParameterField.Any)) self.addParameter( QgsProcessingParameterFileDestination( self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True)) self.addOutput( QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Statistics'))) self.addOutput(QgsProcessingOutputNumber(self.COUNT, self.tr('Count'))) self.addOutput( QgsProcessingOutputNumber(self.UNIQUE, self.tr('Number of unique values'))) self.addOutput( QgsProcessingOutputNumber( self.EMPTY, self.tr('Number of empty (null) values'))) self.addOutput( QgsProcessingOutputNumber(self.FILLED, self.tr('Number of non-empty values'))) self.addOutput( QgsProcessingOutputNumber(self.MIN, self.tr('Minimum value'))) self.addOutput( QgsProcessingOutputNumber(self.MAX, self.tr('Maximum value'))) self.addOutput( QgsProcessingOutputNumber(self.MIN_LENGTH, self.tr('Minimum length'))) self.addOutput( QgsProcessingOutputNumber(self.MAX_LENGTH, self.tr('Maximum length'))) self.addOutput( QgsProcessingOutputNumber(self.MEAN_LENGTH, self.tr('Mean length'))) self.addOutput( QgsProcessingOutputNumber(self.CV, self.tr('Coefficient of Variation'))) self.addOutput(QgsProcessingOutputNumber(self.SUM, self.tr('Sum'))) self.addOutput( QgsProcessingOutputNumber(self.MEAN, self.tr('Mean value'))) self.addOutput( QgsProcessingOutputNumber(self.STD_DEV, self.tr('Standard deviation'))) self.addOutput(QgsProcessingOutputNumber(self.RANGE, self.tr('Range'))) self.addOutput( QgsProcessingOutputNumber(self.MEDIAN, self.tr('Median'))) self.addOutput( QgsProcessingOutputNumber( self.MINORITY, self.tr('Minority (rarest occurring value)'))) self.addOutput( QgsProcessingOutputNumber( self.MAJORITY, self.tr('Majority (most frequently occurring value)'))) self.addOutput( QgsProcessingOutputNumber(self.FIRSTQUARTILE, self.tr('First quartile'))) self.addOutput( QgsProcessingOutputNumber(self.THIRDQUARTILE, self.tr('Third quartile'))) self.addOutput( QgsProcessingOutputNumber(self.IQR, self.tr('Interquartile Range (IQR)')))
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterString(self.SHAPE_ENCODING, self.tr('Shape encoding'), "", optional=True)) self.addParameter( QgsProcessingParameterEnum(self.GTYPE, self.tr('Output geometry type'), options=self.GEOMTYPE, defaultValue=0)) self.addParameter( QgsProcessingParameterCrs(self.A_SRS, self.tr('Assign an output CRS'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterCrs( self.T_SRS, self.tr('Reproject to this CRS on output '), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterCrs(self.S_SRS, self.tr('Override source CRS'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString(self.HOST, self.tr('Host'), defaultValue='localhost', optional=True)) self.addParameter( QgsProcessingParameterString(self.PORT, self.tr('Port'), defaultValue='5432', optional=True)) self.addParameter( QgsProcessingParameterString(self.USER, self.tr('Username'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString(self.DBNAME, self.tr('Database name'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString(self.PASSWORD, self.tr('Password'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString(self.SCHEMA, self.tr('Schema name'), defaultValue='public', optional=True)) self.addParameter( QgsProcessingParameterString( self.TABLE, self.tr('Table name, leave blank to use input name'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString(self.PK, self.tr('Primary key (new field)'), defaultValue='id', optional=True)) self.addParameter( QgsProcessingParameterField( self.PRIMARY_KEY, self. tr('Primary key (existing field, used if the above option is left empty)' ), parentLayerParameterName=self.INPUT, optional=True)) self.addParameter( QgsProcessingParameterString(self.GEOCOLUMN, self.tr('Geometry column name'), defaultValue='geom', optional=True)) self.addParameter( QgsProcessingParameterEnum(self.DIM, self.tr('Vector dimensions'), options=self.DIMLIST, defaultValue=0)) self.addParameter( QgsProcessingParameterString( self.SIMPLIFY, self.tr('Distance tolerance for simplification'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString( self.SEGMENTIZE, self.tr('Maximum distance between 2 nodes (densification)'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterExtent( self.SPAT, self.tr( 'Select features by extent (defined in input layer CRS)'), optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.CLIP, self.tr( 'Clip the input layer using the above (rectangle) extent'), defaultValue=False)) self.addParameter( QgsProcessingParameterField( self.FIELDS, self.tr('Fields to include (leave empty to use all fields)'), parentLayerParameterName=self.INPUT, allowMultiple=True, optional=True)) self.addParameter( QgsProcessingParameterString( self.WHERE, self. tr('Select features using a SQL "WHERE" statement (Ex: column=\'value\')' ), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString( self.GT, self.tr('Group N features per transaction (Default: 20000)'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterBoolean(self.OVERWRITE, self.tr('Overwrite existing table'), defaultValue=True)) self.addParameter( QgsProcessingParameterBoolean(self.APPEND, self.tr('Append to existing table'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.ADDFIELDS, self.tr('Append and add new fields to existing table'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.LAUNDER, self.tr('Do not launder columns/table names'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.INDEX, self.tr('Do not create spatial index'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.SKIPFAILURES, self.tr( 'Continue after a failure, skipping the failed feature'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean(self.PROMOTETOMULTI, self.tr('Promote to Multipart'), defaultValue=True)) self.addParameter( QgsProcessingParameterBoolean( self.PRECISION, self.tr('Keep width and precision of input attributes'), defaultValue=True)) self.addParameter( QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True))
def initAlgorithm(self, config=None): self.DIRECTIONS = OrderedDict([ (self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward), (self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward), (self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)]) self.STRATEGIES = [self.tr('Shortest'), self.tr('Fastest') ] self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Vector layer representing network'), [QgsProcessing.TypeVectorLine])) self.addParameter(QgsProcessingParameterFeatureSource(self.START_POINTS, self.tr('Vector layer with start points'), [QgsProcessing.TypeVectorPoint])) self.addParameter(QgsProcessingParameterPoint(self.END_POINT, self.tr('End point'))) self.addParameter(QgsProcessingParameterEnum(self.STRATEGY, self.tr('Path type to calculate'), self.STRATEGIES, defaultValue=0)) params = [] params.append(QgsProcessingParameterField(self.DIRECTION_FIELD, self.tr('Direction field'), None, self.INPUT, optional=True)) params.append(QgsProcessingParameterString(self.VALUE_FORWARD, self.tr('Value for forward direction'), optional=True)) params.append(QgsProcessingParameterString(self.VALUE_BACKWARD, self.tr('Value for backward direction'), optional=True)) params.append(QgsProcessingParameterString(self.VALUE_BOTH, self.tr('Value for both directions'), optional=True)) params.append(QgsProcessingParameterEnum(self.DEFAULT_DIRECTION, self.tr('Default direction'), list(self.DIRECTIONS.keys()), defaultValue=2)) params.append(QgsProcessingParameterField(self.SPEED_FIELD, self.tr('Speed field'), None, self.INPUT, optional=True)) params.append(QgsProcessingParameterNumber(self.DEFAULT_SPEED, self.tr('Default speed (km/h)'), QgsProcessingParameterNumber.Double, 5.0, False, 0, 99999999.99)) params.append(QgsProcessingParameterDistance(self.TOLERANCE, self.tr('Topology tolerance'), 0.0, self.INPUT, False, 0, 99999999.99)) for p in params: p.setFlags(p.flags() | QgsProcessingParameterDefinition.FlagAdvanced) self.addParameter(p) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Shortest path'), QgsProcessing.TypeVectorLine))
def accept(self): description = self.nameTextBox.text() if description.strip() == '': QMessageBox.warning(self, self.tr('Unable to define parameter'), self.tr('Invalid parameter name')) return if self.param is None: validChars = \ 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' safeName = ''.join(c for c in description if c in validChars) name = safeName.lower() i = 2 while self.alg.parameterDefinition(name): name = safeName.lower() + str(i) i += 1 else: name = self.param.name() if (self.paramType == parameters.PARAMETER_BOOLEAN or isinstance(self.param, QgsProcessingParameterBoolean)): self.param = QgsProcessingParameterBoolean(name, description, self.state.isChecked()) elif (self.paramType == parameters.PARAMETER_TABLE_FIELD or isinstance(self.param, QgsProcessingParameterField)): if self.parentCombo.currentIndex() < 0: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return parent = self.parentCombo.currentData() datatype = self.datatypeCombo.currentData() default = self.defaultTextBox.text() if not default: default = None self.param = QgsProcessingParameterField( name, description, defaultValue=default, parentLayerParameterName=parent, type=datatype, allowMultiple=self.multipleCheck.isChecked()) elif (self.paramType == parameters.PARAMETER_BAND or isinstance(self.param, QgsProcessingParameterBand)): if self.parentCombo.currentIndex() < 0: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return parent = self.parentCombo.currentData() self.param = QgsProcessingParameterBand(name, description, None, parent) elif (self.paramType == parameters.PARAMETER_MAP_LAYER or isinstance(self.param, QgsProcessingParameterMapLayer)): self.param = QgsProcessingParameterMapLayer(name, description) elif (self.paramType == parameters.PARAMETER_RASTER or isinstance(self.param, QgsProcessingParameterRasterLayer)): self.param = QgsProcessingParameterRasterLayer(name, description) elif (self.paramType == parameters.PARAMETER_TABLE or isinstance(self.param, QgsProcessingParameterVectorLayer)): self.param = QgsProcessingParameterVectorLayer( name, description, [self.shapetypeCombo.currentData()]) elif (self.paramType == parameters.PARAMETER_VECTOR or isinstance(self.param, QgsProcessingParameterFeatureSource)): self.param = QgsProcessingParameterFeatureSource( name, description, [self.shapetypeCombo.currentData()]) elif (self.paramType == parameters.PARAMETER_MULTIPLE or isinstance(self.param, QgsProcessingParameterMultipleLayers)): self.param = QgsProcessingParameterMultipleLayers( name, description, self.datatypeCombo.currentData()) elif (self.paramType == parameters.PARAMETER_NUMBER or isinstance( self.param, (QgsProcessingParameterNumber, QgsProcessingParameterDistance))): try: self.param = QgsProcessingParameterNumber( name, description, QgsProcessingParameterNumber.Double, self.defaultTextBox.text()) vmin = self.minTextBox.text().strip() if not vmin == '': self.param.setMinimum(float(vmin)) vmax = self.maxTextBox.text().strip() if not vmax == '': self.param.setMaximum(float(vmax)) except: QMessageBox.warning( self, self.tr('Unable to define parameter'), self.tr('Wrong or missing parameter values')) return elif (self.paramType == parameters.PARAMETER_EXPRESSION or isinstance(self.param, QgsProcessingParameterExpression)): parent = self.parentCombo.currentData() self.param = QgsProcessingParameterExpression( name, description, str(self.defaultEdit.expression()), parent) elif (self.paramType == parameters.PARAMETER_STRING or isinstance(self.param, QgsProcessingParameterString)): self.param = QgsProcessingParameterString( name, description, str(self.defaultTextBox.text())) elif (self.paramType == parameters.PARAMETER_EXTENT or isinstance(self.param, QgsProcessingParameterExtent)): self.param = QgsProcessingParameterExtent(name, description) elif (self.paramType == parameters.PARAMETER_FILE or isinstance(self.param, QgsProcessingParameterFile)): isFolder = self.fileFolderCombo.currentIndex() == 1 self.param = QgsProcessingParameterFile( name, description, QgsProcessingParameterFile.Folder if isFolder else QgsProcessingParameterFile.File) elif (self.paramType == parameters.PARAMETER_POINT or isinstance(self.param, QgsProcessingParameterPoint)): self.param = QgsProcessingParameterPoint( name, description, str(self.defaultTextBox.text())) elif (self.paramType == parameters.PARAMETER_CRS or isinstance(self.param, QgsProcessingParameterCrs)): self.param = QgsProcessingParameterCrs( name, description, self.selector.crs().authid()) elif (self.paramType == parameters.PARAMETER_ENUM or isinstance(self.param, QgsProcessingParameterEnum)): self.param = QgsProcessingParameterEnum( name, description, self.widget.options(), self.widget.allowMultiple(), self.widget.defaultOptions()) elif (self.paramType == parameters.PARAMETER_MATRIX or isinstance(self.param, QgsProcessingParameterMatrix)): self.param = QgsProcessingParameterMatrix( name, description, hasFixedNumberRows=self.widget.fixedRows(), headers=self.widget.headers(), defaultValue=self.widget.value()) # Destination parameter elif (isinstance(self.param, QgsProcessingParameterFeatureSink)): self.param = QgsProcessingParameterFeatureSink( name=name, description=self.param.description(), type=self.param.dataType(), defaultValue=self.defaultWidget.getValue()) elif (isinstance(self.param, QgsProcessingParameterFileDestination)): self.param = QgsProcessingParameterFileDestination( name=name, description=self.param.description(), fileFilter=self.param.fileFilter(), defaultValue=self.defaultWidget.getValue()) elif (isinstance(self.param, QgsProcessingParameterFolderDestination)): self.param = QgsProcessingParameterFolderDestination( name=name, description=self.param.description(), defaultValue=self.defaultWidget.getValue()) elif (isinstance(self.param, QgsProcessingParameterRasterDestination)): self.param = QgsProcessingParameterRasterDestination( name=name, description=self.param.description(), defaultValue=self.defaultWidget.getValue()) elif (isinstance(self.param, QgsProcessingParameterVectorDestination)): self.param = QgsProcessingParameterVectorDestination( name=name, description=self.param.description(), type=self.param.dataType(), defaultValue=self.defaultWidget.getValue()) else: if self.paramType: typeId = self.paramType else: typeId = self.param.type() paramTypeDef = QgsApplication.instance().processingRegistry( ).parameterType(typeId) if not paramTypeDef: msg = self.tr( 'The parameter `{}` is not registered, are you missing a required plugin?' .format(typeId)) raise UndefinedParameterException(msg) self.param = paramTypeDef.create(name) self.param.setDescription(description) self.param.setMetadata(paramTypeDef.metadata()) if not self.requiredCheck.isChecked(): self.param.setFlags( self.param.flags() | QgsProcessingParameterDefinition.FlagOptional) else: self.param.setFlags( self.param.flags() & ~QgsProcessingParameterDefinition.FlagOptional) settings = QgsSettings() settings.setValue( "/Processing/modelParametersDefinitionDialogGeometry", self.saveGeometry()) QDialog.accept(self)
def initAlgorithm(self, config=None): self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterEnum(self.PLOT_TYPE, self.tr('Plot type'), options=self.PLOT_TYPE_OPTIONS)) self.addParameter( QgsProcessingParameterString(self.PLOT_TITLE, self.tr('Plot title'), optional=True)) self.addParameter( QgsProcessingParameterField(self.XFIELD, self.tr('X Field'), parentLayerParameterName=self.INPUT, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterField(self.YFIELD, self.tr('Y Field'), parentLayerParameterName=self.INPUT, type=QgsProcessingParameterField.Any, optional=True)) self.addParameter( QgsProcessingParameterEnum(self.IN_COLOR, self.tr('Color'), optional=True, options=self.IN_COLOR_OPTIONS)) self.addParameter( QgsProcessingParameterString( self.IN_COLOR_HTML, self. tr('Color (any valid HTML color) If set, this is used instead of the color set in the previous input.' ), optional=True)) self.addParameter( QgsProcessingParameterFileDestination( self.OUTPUT_HTML_FILE, self.tr('HTML File'), self.tr('HTML files (*.html)'))) # need to add an output for it to allow to see it in Processus results viewer self.addOutput( QgsProcessingOutputHtml( self.OUTPUT_HTML_FILE, self.tr('Dataplotly - Generic plot HTML output'))) # Add an file to return a response in JSON format self.addParameter( QgsProcessingParameterFileDestination( self.OUTPUT_JSON_FILE, self.tr('JSON file'), self.tr('JSON Files (*.json)'))) # need to add an output for it to allow to see it in Processus results viewer self.addOutput( QgsProcessingOutputFile( self.OUTPUT_JSON_FILE, self.tr('Dataplotly - Generic plot JSON output')))
def initAlgorithm(self, config=None): db_param = QgsProcessingParameterString( self.DATABASE, self.tr('Database (connection name)')) db_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.ConnectionWidgetWrapper' } }) self.addParameter(db_param) self.addParameter( QgsProcessingParameterFeatureSource(self.INPUT, self.tr('Input layer'))) self.addParameter( QgsProcessingParameterString(self.SHAPE_ENCODING, self.tr('Shape encoding'), "", optional=True)) self.addParameter( QgsProcessingParameterEnum(self.GTYPE, self.tr('Output geometry type'), options=self.GEOMTYPE, defaultValue=0)) self.addParameter( QgsProcessingParameterCrs(self.A_SRS, self.tr('Assign an output CRS'), defaultValue='', optional=False)) self.addParameter( QgsProcessingParameterCrs( self.T_SRS, self.tr('Reproject to this CRS on output '), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterCrs(self.S_SRS, self.tr('Override source CRS'), defaultValue='', optional=True)) schema_param = QgsProcessingParameterString( self.SCHEMA, self.tr('Schema (schema name)'), 'public', False, True) schema_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.SchemaWidgetWrapper', 'connection_param': self.DATABASE } }) self.addParameter(schema_param) table_param = QgsProcessingParameterString( self.TABLE, self.tr('Table to import to (leave blank to use layer name)'), '', False, True) table_param.setMetadata({ 'widget_wrapper': { 'class': 'processing.gui.wrappers_postgis.TableWidgetWrapper', 'schema_param': self.SCHEMA } }) self.addParameter(table_param) self.addParameter( QgsProcessingParameterString(self.PK, self.tr('Primary key (new field)'), defaultValue='id', optional=True)) self.addParameter( QgsProcessingParameterField( self.PRIMARY_KEY, self. tr('Primary key (existing field, used if the above option is left empty)' ), parentLayerParameterName=self.INPUT, optional=True)) self.addParameter( QgsProcessingParameterString(self.GEOCOLUMN, self.tr('Geometry column name'), defaultValue='geom', optional=True)) self.addParameter( QgsProcessingParameterEnum(self.DIM, self.tr('Vector dimensions'), options=self.DIMLIST, defaultValue=0)) self.addParameter( QgsProcessingParameterString( self.SIMPLIFY, self.tr('Distance tolerance for simplification'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString( self.SEGMENTIZE, self.tr('Maximum distance between 2 nodes (densification)'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterExtent( self.SPAT, self.tr( 'Select features by extent (defined in input layer CRS)'), optional=True)) self.addParameter( QgsProcessingParameterBoolean( self.CLIP, self.tr( 'Clip the input layer using the above (rectangle) extent'), defaultValue=False)) self.addParameter( QgsProcessingParameterString( self.WHERE, self. tr('Select features using a SQL "WHERE" statement (Ex: column=\'value\')' ), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterString( self.GT, self.tr('Group N features per transaction (Default: 20000)'), defaultValue='', optional=True)) self.addParameter( QgsProcessingParameterBoolean(self.OVERWRITE, self.tr('Overwrite existing table'), defaultValue=True)) self.addParameter( QgsProcessingParameterBoolean(self.APPEND, self.tr('Append to existing table'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.ADDFIELDS, self.tr('Append and add new fields to existing table'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.LAUNDER, self.tr('Do not launder columns/table names'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.INDEX, self.tr('Do not create spatial index'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean( self.SKIPFAILURES, self.tr( 'Continue after a failure, skipping the failed feature'), defaultValue=False)) self.addParameter( QgsProcessingParameterBoolean(self.PROMOTETOMULTI, self.tr('Promote to Multipart'), defaultValue=True)) self.addParameter( QgsProcessingParameterBoolean( self.PRECISION, self.tr('Keep width and precision of input attributes'), defaultValue=True)) self.addParameter( QgsProcessingParameterString( self.OPTIONS, self.tr('Additional creation options'), defaultValue='', optional=True))
def initAlgorithm(self, config): currentPath = getCurrentPath(self) FULL_PATH = buildFullPathName(currentPath, nameWithOuputExtension(NAMES_INDEX['IA04'][1])) self.addParameter( QgsProcessingParameterFeatureSource( self.BLOCKS_LAST, self.tr('Manzanas en el último año'), [QgsProcessing.TypeVectorPolygon] ) ) self.addParameter( QgsProcessingParameterField( self.FIELD_POPULATION_LAST, self.tr('Población en el último año'), 'poblacion', 'BLOCKS_LAST' ) ) self.addParameter( QgsProcessingParameterFeatureSource( self.BLOCKS_BEGIN, self.tr('Manzanas en el año inicial'), [QgsProcessing.TypeVectorPolygon] ) ) self.addParameter( QgsProcessingParameterField( self.FIELD_POPULATION_BEGIN, self.tr('Población en el último año'), 'poblacion', 'BLOCKS_BEGIN' ) ) self.addParameter( QgsProcessingParameterFeatureSource( self.STUDY_AREA_GRID, self.tr(TEXT_GRID_INPUT), [QgsProcessing.TypeVectorPolygon], '', OPTIONAL_GRID_INPUT ) ) self.addParameter( QgsProcessingParameterFeatureSource( self.BUILT_LAST, self.tr('Área edificada en el último año'), [QgsProcessing.TypeVectorPolygon] ) ) self.addParameter( QgsProcessingParameterFeatureSource( self.BUILT_BEGIN, self.tr('Área edificada en el año inicial'), [QgsProcessing.TypeVectorPolygon] ) ) self.addParameter( QgsProcessingParameterNumber( self.YEARS, self.tr('Años entre el inicial y el final'), QgsProcessingParameterNumber.Integer, 10, False, 1, 99999999 ) ) if OPTIONAL_GRID_INPUT: self.addParameter( QgsProcessingParameterNumber( self.CELL_SIZE, self.tr('Tamaño de la malla'), QgsProcessingParameterNumber.Integer, P_CELL_SIZE, False, 1, 99999999 ) ) self.addParameter( QgsProcessingParameterFeatureSink( self.OUTPUT, self.tr('Salida'), QgsProcessing.TypeVectorAnyGeometry, str(FULL_PATH) ) )