I am writing a Processing Algorithm based on this template. Can I populate the QgsProcessingParameterFeatureSink from a delimitedtext provider in a similar fashion to the iface.addVectorLayer() (i.e. the following code snippet) ?

uri = ('file:///{}?'

layer = iface.addVectorLayer(uri, 'MY LAYER',  'delimitedtext')

You don't need to use feature sink parameters for a hard-coded layer like this. Just load it direct via

vl=QgsVectorLayer(uri, 'MY LAYER',  'delimitedtext')
  • Thanks, so based on the mentioned template, how should I define my output? QgsVectorLayer directly? – YeO Apr 22 '18 at 2:51
  • I've tried to define my output as QgsProcessingParameterVectorDestination (rather than QgsProcessingParameterVectorLayer) then set vl = self.parameterAsVectorLayer(parameters, self.OUTPUT, context) but I can't make it work. – YeO Apr 22 '18 at 5:27
  • I've made it a new question as my problem is now how to get my Algorithm return this vl. – YeO Apr 28 '18 at 4:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.