I'm using QGIS 2.18.11. So I have a list of various coordinates and rotation angle. I'd like to paste a template polygon with each of their center point positioned on each coordinate and rotated by an angle as specified in the list. For the translation part, I tried to use the method outlined here: Move a layer in QGIS to a precise position based on centroid but got stuck near the end because QgsFeature.setGeometry() is voided.
feat = QgsFeature()
feat.setGeomertry(QgsGeometry.fromPolygon(pol_t))
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'QgsFeature' object has no attribute 'setGeomertry'
As for the rotation part, I came across QgsVector.rotateBy() that seems to be able to do the trick. Am I on the right track?
{}button that enables you to format any highlighted code nicely. – PolyGeo Sep 18 '17 at 03:04setGeomertrydo you meansetGeometry? – alphabetasoup Sep 19 '17 at 03:56QgsGeometry.rotate()but with no luck – GIS_Newbie Sep 19 '17 at 09:26