Hello,
I need to scale a polygon from python code.
An extract of source code is the following :
for feat in iter:
geom = feat.geometry()
rect = geom.boundingBox()
x1 = rect.xMinimum()
y1 = rect.yMinimum()
x2 =
Hi
From QGIS 2.8 there is QgsGeometry.transform() method that works with
QTransform. The following code will scale the sample line segment:
from PyQt4.QtGui import QTransform
g = QgsGeometry.fromPolyline([QgsPoint(-1,0),QgsPoint(1,0)])
g.transform( QTransform().scale(2,2) )
print g.asPolyline()