I can rotate polygon features in a shapefile using:
vlayer = iface.activeLayer()
vlayer.startEditing()
for ft in vlayer.getFeatures():
geom = ft.geometry()
pt = ft.geometry().centroid().asPoint()
geom.rotate(45, pt)
vlayer.dataProvider().changeGeometryValues({ 0 : geom })
vlayer.commitChanges()
But if I use this on a memory layer, nothing happens. True
values are printed on the console but the features are not rotated, even after refreshing the canvas and repainting the layer.
Is there a way to do this for memory layers?