Exemple #1
0
    def load(self):
        success = super().load()

        from processing.core.Processing import Processing

        if success:
            Processing.registerParameter(
                'Fields Mapper',
                self.fieldMappingParameterName,
                parameter=FieldsMapper.ParameterFieldsMapping,
                metadata={'widget_wrapper': 'processing.algs.qgis.ui.FieldsMappingPanel.FieldsMappingWidgetWrapper'}
            )

        return success
Exemple #2
0
    def load(self):
        success = super().load()

        from processing.core.Processing import Processing

        if success:
            Processing.registerParameter(
                'Fields Mapper',
                self.fieldMappingParameterName,
                parameter=FieldsMapper.ParameterFieldsMapping,
                metadata={'widget_wrapper': 'processing.algs.qgis.ui.FieldsMappingPanel.FieldsMappingWidgetWrapper'}
            )

        return success
Exemple #3
0
def initializeParameters():
    from processing.core.Processing import Processing

    Processing.registerParameter(PARAMETER_MAP_LAYER, QCoreApplication.translate('Processing', 'Map Layer'),
                                 QgsProcessingParameterMapLayer,
                                 description=QCoreApplication.translate('Processing', 'A generic map layer parameter, which accepts either vector or raster layers.'))
    Processing.registerParameter(PARAMETER_BAND, QCoreApplication.translate('Processing', 'Raster Band'),
                                 QgsProcessingParameterBand,
                                 description=QCoreApplication.translate('Processing', 'A raster band parameter, for selecting an existing band from a raster source.'))
    Processing.registerParameter(PARAMETER_EXPRESSION, QCoreApplication.translate('Processing', 'Expression'),
                                 QgsProcessingParameterExpression,
                                 description=QCoreApplication.translate('Processing', 'A QGIS expression parameter, which presents an expression builder widget to users.'))
    Processing.registerParameter(PARAMETER_RASTER, QCoreApplication.translate('Processing', 'Raster Layer'), QgsProcessingParameterRasterLayer,
                                 description=QCoreApplication.translate('Processing', 'A raster layer parameter.'))
    Processing.registerParameter(PARAMETER_TABLE, QCoreApplication.translate('Processing', 'Vector Layer'), QgsProcessingParameterVectorLayer,
                                 description=QCoreApplication.translate('Processing', 'A vector feature parameter, e.g. for algorithms which operate on the features within a layer.'))
    Processing.registerParameter(PARAMETER_BOOLEAN, QCoreApplication.translate('Processing', 'Boolean'), QgsProcessingParameterBoolean,
                                 description=QCoreApplication.translate('Processing', 'A boolean parameter, for true/false values.'))
    Processing.registerParameter(PARAMETER_CRS, QCoreApplication.translate('Processing', 'CRS'), QgsProcessingParameterCrs,
                                 description=QCoreApplication.translate('Processing', 'A coordinate reference system (CRS) input parameter.'))
    Processing.registerParameter(PARAMETER_RANGE, QCoreApplication.translate('Processing', 'Range'), QgsProcessingParameterRange)
    Processing.registerParameter(PARAMETER_POINT, QCoreApplication.translate('Processing', 'Point'), QgsProcessingParameterPoint,
                                 description=QCoreApplication.translate('Processing', 'A geographic point parameter.'))
    Processing.registerParameter(PARAMETER_ENUM, QCoreApplication.translate('Processing', 'Enum'), QgsProcessingParameterEnum, exposeToModeller=False)
    Processing.registerParameter(PARAMETER_EXTENT, QCoreApplication.translate('Processing', 'Extent'), QgsProcessingParameterExtent,
                                 description=QCoreApplication.translate('Processing', 'A map extent parameter.'))
    Processing.registerParameter(PARAMETER_MATRIX, QCoreApplication.translate('Processing', 'Matrix'), QgsProcessingParameterMatrix)
    Processing.registerParameter(PARAMETER_FILE, QCoreApplication.translate('Processing', 'File'), QgsProcessingParameterFile,
                                 description=QCoreApplication.translate('Processing', 'A file parameter, for use with non-map layer file sources.'))
    Processing.registerParameter(PARAMETER_TABLE_FIELD, QCoreApplication.translate('Processing', 'Field'), QgsProcessingParameterField,
                                 description=QCoreApplication.translate('Processing', 'A vector field parameter, for selecting an existing field from a vector source.'))
    Processing.registerParameter(PARAMETER_VECTOR_DESTINATION, QCoreApplication.translate('Processing', 'Vector Destination'), QgsProcessingParameterVectorDestination, exposeToModeller=False)
    Processing.registerParameter(PARAMETER_FILE_DESTINATION, QCoreApplication.translate('Processing', 'File Destination'), QgsProcessingParameterFileDestination, exposeToModeller=False)
    Processing.registerParameter(PARAMETER_FOLDER_DESTINATION, QCoreApplication.translate('Processing', 'Folder Destination'), QgsProcessingParameterFolderDestination, exposeToModeller=False)
    Processing.registerParameter(PARAMETER_RASTER_DESTINATION, QCoreApplication.translate('Processing', 'Raster Destination'), QgsProcessingParameterRasterDestination, exposeToModeller=False)
    Processing.registerParameter(PARAMETER_STRING, QCoreApplication.translate('Processing', 'String'), QgsProcessingParameterString,
                                 description=QCoreApplication.translate('Processing', 'A freeform string parameter.'))
    Processing.registerParameter(PARAMETER_MULTIPLE, QCoreApplication.translate('Processing', 'Multiple Layers'), QgsProcessingParameterMultipleLayers,
                                 description=QCoreApplication.translate('Processing', 'An input allowing selection of multiple sources, including multiple map layers or file sources.'))
    Processing.registerParameter(PARAMETER_VECTOR, QCoreApplication.translate('Processing', 'Feature Source'), QgsProcessingParameterFeatureSource)
    Processing.registerParameter(PARAMETER_NUMBER, QCoreApplication.translate('Processing', 'Number'), QgsProcessingParameterNumber,
                                 description=QCoreApplication.translate('Processing', 'A numeric parameter, including float or integer values.'))
    Processing.registeredParameters()
Exemple #4
0
def initializeParameters():
    from processing.core.Processing import Processing

    Processing.registerParameter(
        PARAMETER_MAP_LAYER,
        QCoreApplication.translate('Processing', 'Map Layer'),
        QgsProcessingParameterMapLayer,
        description=QCoreApplication.translate(
            'Processing',
            'A generic map layer parameter, which accepts either vector or raster layers.'
        ))
    Processing.registerParameter(
        PARAMETER_BAND,
        QCoreApplication.translate('Processing', 'Raster Band'),
        QgsProcessingParameterBand,
        description=QCoreApplication.translate(
            'Processing',
            'A raster band parameter, for selecting an existing band from a raster source.'
        ))
    Processing.registerParameter(
        PARAMETER_EXPRESSION,
        QCoreApplication.translate('Processing', 'Expression'),
        QgsProcessingParameterExpression,
        description=QCoreApplication.translate(
            'Processing',
            'A QGIS expression parameter, which presents an expression builder widget to users.'
        ))
    Processing.registerParameter(
        PARAMETER_RASTER,
        QCoreApplication.translate('Processing', 'Raster Layer'),
        QgsProcessingParameterRasterLayer,
        description=QCoreApplication.translate('Processing',
                                               'A raster layer parameter.'))
    Processing.registerParameter(
        PARAMETER_TABLE,
        QCoreApplication.translate('Processing', 'Vector Layer'),
        QgsProcessingParameterVectorLayer,
        description=QCoreApplication.translate(
            'Processing',
            'A vector feature parameter, e.g. for algorithms which operate on the features within a layer.'
        ))
    Processing.registerParameter(
        PARAMETER_BOOLEAN,
        QCoreApplication.translate('Processing', 'Boolean'),
        QgsProcessingParameterBoolean,
        description=QCoreApplication.translate(
            'Processing', 'A boolean parameter, for true/false values.'))
    Processing.registerParameter(
        PARAMETER_CRS,
        QCoreApplication.translate('Processing', 'CRS'),
        QgsProcessingParameterCrs,
        description=QCoreApplication.translate(
            'Processing',
            'A coordinate reference system (CRS) input parameter.'))
    Processing.registerParameter(
        PARAMETER_RANGE, QCoreApplication.translate('Processing', 'Range'),
        QgsProcessingParameterRange)
    Processing.registerParameter(PARAMETER_POINT,
                                 QCoreApplication.translate(
                                     'Processing', 'Point'),
                                 QgsProcessingParameterPoint,
                                 description=QCoreApplication.translate(
                                     'Processing',
                                     'A geographic point parameter.'))
    Processing.registerParameter(PARAMETER_ENUM,
                                 QCoreApplication.translate(
                                     'Processing', 'Enum'),
                                 QgsProcessingParameterEnum,
                                 exposeToModeller=False)
    Processing.registerParameter(
        PARAMETER_EXTENT,
        QCoreApplication.translate('Processing', 'Extent'),
        QgsProcessingParameterExtent,
        description=QCoreApplication.translate('Processing',
                                               'A map extent parameter.'))
    Processing.registerParameter(
        PARAMETER_MATRIX, QCoreApplication.translate('Processing', 'Matrix'),
        QgsProcessingParameterMatrix)
    Processing.registerParameter(
        PARAMETER_FILE,
        QCoreApplication.translate('Processing', 'File'),
        QgsProcessingParameterFile,
        description=QCoreApplication.translate(
            'Processing',
            'A file parameter, for use with non-map layer file sources.'))
    Processing.registerParameter(
        PARAMETER_TABLE_FIELD,
        QCoreApplication.translate('Processing', 'Field'),
        QgsProcessingParameterField,
        description=QCoreApplication.translate(
            'Processing',
            'A vector field parameter, for selecting an existing field from a vector source.'
        ))
    Processing.registerParameter(PARAMETER_VECTOR_DESTINATION,
                                 QCoreApplication.translate(
                                     'Processing', 'Vector Destination'),
                                 QgsProcessingParameterVectorDestination,
                                 exposeToModeller=False)
    Processing.registerParameter(PARAMETER_FILE_DESTINATION,
                                 QCoreApplication.translate(
                                     'Processing', 'File Destination'),
                                 QgsProcessingParameterFileDestination,
                                 exposeToModeller=False)
    Processing.registerParameter(PARAMETER_FOLDER_DESTINATION,
                                 QCoreApplication.translate(
                                     'Processing', 'Folder Destination'),
                                 QgsProcessingParameterFolderDestination,
                                 exposeToModeller=False)
    Processing.registerParameter(PARAMETER_RASTER_DESTINATION,
                                 QCoreApplication.translate(
                                     'Processing', 'Raster Destination'),
                                 QgsProcessingParameterRasterDestination,
                                 exposeToModeller=False)
    Processing.registerParameter(
        PARAMETER_STRING,
        QCoreApplication.translate('Processing', 'String'),
        QgsProcessingParameterString,
        description=QCoreApplication.translate('Processing',
                                               'A freeform string parameter.'))
    Processing.registerParameter(
        PARAMETER_MULTIPLE,
        QCoreApplication.translate('Processing', 'Multiple Layers'),
        QgsProcessingParameterMultipleLayers,
        description=QCoreApplication.translate(
            'Processing',
            'An input allowing selection of multiple sources, including multiple map layers or file sources.'
        ))
    Processing.registerParameter(
        PARAMETER_VECTOR,
        QCoreApplication.translate('Processing', 'Feature Source'),
        QgsProcessingParameterFeatureSource)
    Processing.registerParameter(
        PARAMETER_NUMBER,
        QCoreApplication.translate('Processing', 'Number'),
        QgsProcessingParameterNumber,
        description=QCoreApplication.translate(
            'Processing',
            'A numeric parameter, including float or integer values.'))
    Processing.registeredParameters()