Hello, a simple question about changing geometry ...

I create a simple point layer, with two point, my simple objective is to change the geometry of point 1 by copying the geometry of point 2 into geometry of point1.

I select one of my point, and I run this source code into python console :

--

mapC = qgis.utils.iface.mapCanvas()
layer = mapC.currentLayer()
provider = layer.dataProvider()
feat = QgsFeature()
provider.nextFeature(feat)

myGeom = feat.geometry()

while provider.nextFeature(feat):
    layer.startEditing()
feat.setGeometry(myGeom) #replace the feature geometry by the geometry of mygeom
    layer.commitChanges()

--

Qgis crash after that, but i don't understand why ??
Can anyone help me on this function setGeometry ?

Thanks a lot,
Best regards,
SR.
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to