4

I get an error:

"Invalid type in constructor arguments."

for a QgsPoint in QGIS 3.

I was fine in QGIS 2, it never gets to print D

for steps in range(numVertices):
     vertex = geom.vertexAt(steps)
     print("C", vertex)
     pt = QgsPoint(vertex)
     print("D")
     points.append(pt)
1

1 Answer 1

6

vertexAt method returns QgsPoint. So, you don't need to construct new one. You get the error since QgsPoint class doesn't have any constructor method which takes a QgsPoint argument in QGIS 3 unlike QGIS 2.

Use this:

for steps in range(numVertices):
     pt = geom.vertexAt(steps)
     points.append(pt)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.