Hi all,

I am currently using the "Snap to Roads" script inside my qgis environment, to 
match gpx-points to the OSM 
(https://spatialthoughts.com/2020/02/22/snap-to-roads-qgis-and-osrm/).



I am able to execute the Script by using the QGIS Script Environment:

[cid:317d9d57-3f6d-41dd-8234-b68dcfa66fc2]


Unfortunatly, I would like to run the script via python console inside QGiS, 
but this doesn't work at all ...


By executing the following command:


layer_SnappedLine = processing.run("script:snap_to_roads",
{'INPUT':layer_GPX_Points['OUTPUT'],
'SERVICE':'http://127.0.0.1:5000',
'TOLERANCE':10,
'OUTPUT':'TEMPORARY_OUTPUT'})


I receive the error message:

"Traceback (most recent call last):

  File "C:\PROGRA~1\QGIS32~1.10\apps\Python39\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File 
"C:\PROGRA~1/QGIS32~1.10/apps/qgis-ltr/./python/plugins\processing\tools\general.py",
 line 108, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, 
context)
  File 
"C:\PROGRA~1/QGIS32~1.10/apps/qgis-ltr/./python/plugins\processing\core\Processing.py",
 line 205, in runAlgorithm
    layer = context.takeResultLayer(result)  # transfer layer ownership out of 
context
TypeError: QgsProcessingContext.takeResultLayer(): argument 1 has unexpected 
type 'QgsFeatureSink'"

Can anybody help me with this issue? I am using QGIS Version 3.22.10

Regards and thanks,
Marie
_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to