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:///{}?'
'type=regexp'
'&delimiter={}'
'&skipLines={}'
'&useHeader=No'
'&trimFields=Yes'
'&xField=field_11'
'&yField=field_12'
'&crs={}'
'&spatialIndex=Yes'
'&subsetIndex=no'
'&watchFile=Yes').format(myFile,
myRe,
countSkips(myFile),
myCrs)
layer = iface.addVectorLayer(uri, 'MY LAYER', 'delimitedtext')
Answer
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')
No comments:
Post a Comment