1

I have a processing script to load txt-data from a magnetometer and convert them into a vectorlayer (to make a raster in a second step). I want the name of output layer to be changed into something related to the input filename. The initAlgorithm function looks like this:

def initAlgorithm(self, config=None):
    # We add the input File Parameter.
    self.addParameter(
    QgsProcessingParameterFile(
        self.INPUT,
        self.tr('Magnetometer File'),
        0,
        'txt'
       )
    )
    # and the output vector layer
    self.addParameter(QgsProcessingParameterFeatureSink(
        self.OUTPUT,
        self.tr('Magnetometer points'),
        type=QgsProcessing.TypeVectorPoint))

The new output layer is named Magnetometer points, but should be better something like Magnetometer points File1

How and where can I achieve this - I suppose in the processAlgorithm function?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.