<div dir="ltr"><div><div>Hello,<br><br><br></div>I need to scale a polygon from python code.<br><br>An extract of source code is the following :<br></div><div><div><div><br>           for feat in iter:<br>              geom = feat.geometry()<br>              rect = geom.boundingBox()<br>            <br>              x1 = rect.xMinimum()<br>              y1 = rect.yMinimum()<br>                <br>              x2 = rect.xMaximum()<br>              y2 = rect.yMinimum()<br>              <br>              xc = (x2 + x1) / 2.0              <br>              yc = (y2 + y1) / 2.0<br>                           <br>                elem = geom.asPolygon()<br><br>                fat = float(scale) / 100.<br><br>                for i in range(geom.exportToWkt().count(',')):<br>                <br>                            vertex = geom.vertexAt(i)<br><br>                            x,y = vertex.x(), vertex.y()                                <br><br>                            xR, yR = x-xc , y-yc<br>                            xS, yS = xR*fat, yR*fat<br> <br>                             xT, yT = xS + xc, yS + yc <br> <br>                             geom.moveVertex(xT, yT, i)<br><br><br></div><div>Because the polygon do not change, sure I miss something, to save the modified element, also if the layer is in editing.<br><br></div><div>Someone could help me to understand what I wrong ?<br><br><br></div><div>Thank you<br><br></div><div>Roberto<br></div><div><br></div></div></div></div>