I have a Python script that I have exported from a QGIS model and I want to specify the layer it creates as output.
If defaultValue=None
it outputs 'Reportpmbc'
: 'Centroids_9c779c9c_4bcc_471b_971e_fbea3bb27c7d'
, in the log window and a 'Centroids'
layer is created in the project.
I want it to create a temporary layer 'Report-PMBC'
as below but it won't run. (“.” files are not supported as outputs for this algorithm)
What am I missing in the statement below? I think I have to create a temporary layer in memory and write to it but I am not sure how to do that.
self.addParameter(QgsProcessingParameterFeatureSink('Reportpmbc', 'Report-PMBC', type=QgsProcessing.TypeVectorPoint, createByDefault=True, defaultValue='Report-PMBC'))