Skip to main content
deleted 20 characters in body; deleted 36 characters in body
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188

fromPointXY creates a new geometry from a QgsPointXY object which is a tuple withcreated by providing two float coordinates, i.e. "X" and "Y".

So, try the following expression:

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))

fromPointXY creates a new geometry from a QgsPointXY object which is a tuple with two float coordinates, i.e. "X" and "Y".

So, try the following expression

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))

fromPointXY creates a new geometry from a QgsPointXY object which is created by providing two coordinates:

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))
Tiny adjustments
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

fromPointXY wantscreates a new geometry from a QgsPointXY object which is a tuple with two float coordinates, i.e. QgsPointXY"X" and "Y".

So, try: the following expression

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))

fromPointXY wants a QgsPointXY, try:

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))

fromPointXY creates a new geometry from a QgsPointXY object which is a tuple with two float coordinates, i.e. "X" and "Y".

So, try the following expression

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188

fromPointXY wants a QgsPointXY, try:

feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))