I have one input point layer and out of that, I want to create an output LINE vector layer.
For each feature in my output line vector layer, I define a geometry which takes 2 point geometries. Figuratively speaking, imagine a line which connects both points -> this should be the line feature I want to add to my output layer!
I have tried it like this:
newEdge = QgsFeature(outFields)
geom = QgsGeometry.fromPolyline([geomFrom.asPoint(),geomTo.asPoint()]) # The error happens here!
newEdge.setGeometry(geom)
This had worked for me in QGIS2.x, but with QGIS3, I get the following error:
Traceback (most recent call last): File "", line 194, in processAlgorithm TypeError: index 0 has type 'QgsPointXY' but 'QgsPoint' is expected
Any suggestions?