[Qgis-user] Vector Layer Translate Feature

Carson Farmer carson.farmer at gmail.com
Mon Mar 30 06:28:40 PDT 2009


Pietro
>
> I use the following code:
>
> vlayer = iface.activeLayer()
>
> provider = vlayer.dataProvider()
> attrs = provider.attributeIndexes()
> provider.select(attrs)
>
> f = QgsFeature()
>
> while provider.nextFeature(f):
> 	error_code = vlayer.translateFeature(f.id(), delta_x, delta_y)
>
>
> If the feature to translate is not one of the visualized features, the 
> error_code is 1 and the feature is not translated.
>   
ah now that I think about it... this might be an issue with the editing 
tools... it could be a bug with the function itself (not your 
implementation). I think I remember hearing something about this on the 
dev list at some point... maybe post your question there, specifically 
asking about the translate feature function regarding features out of 
the view...

Carson



More information about the Qgis-user mailing list