I'm trying to run the following algorithm which runs fine when I select a layer I imported from the CSV file in question but not when I just try to run if from the file itself.
input = '/media/path/points.csv=csv&detectTypes=yes&xField=long&yField=lat&crs=EPSG:103172&spatialIndex=no&subsetIndex=no&watchFile=no'
layers = QgsProject.instance().mapLayersByName('points')
#input = layers[0]
output = '/media/path/outline.shp'
params = { 'DATE_FORMAT' : '', 'GROUP_FIELD' : 'rid', 'INPUT' : input, 'ORDER_FIELD' : 'vertex_ind', 'OUTPUT' : output }
res = processing.run('qgis:pointstopath', params)
I'm getting:
File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 137, in runAlgorithm raise QgsProcessingException(msg) _core.QgsProcessingException: Unable to execute algorithm Could not load source layer for INPUT: /media/path/points.csv=csv&detectTypes=yes&xField=long&yField=lat&crs=EPSG:103172&spatialIndex=no&subsetIndex=no&watchFile=no not found
layers = QgsProject.instance().mapLayersByName('points')
withlayers = QgsVectorLayer("file:///" + input, "point", "delimitedtext")
and then replace'INPUT' : input
with'INPUT' : layers
inparams
.