Pietro,
I'm writing a Python plugin to allow the user to translate a whole vector layer by a given shift.

I use the translateFeature() of the QgsVectorLayer class but if the layer is zoomed the function translates only the visualized features.

Can someone point me a way to act on the whole layer regardless of the current zoom?
In your provider.select() call, what do you use for the spatial filter? If you want to run through all features in the layer, make sure you don't specify any bounds in the rect variable:

attrs = provider.attributeIndexes()
provider.select(attrs)

or if that doesn't work, specify the extent of the layer as the rect using layer.extent(), which is inherited from QgsMapLayer...

Cheers,

Carson

--
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
Email: carson.far...@gmail.com
Web:   http://www.carsonfarmer.com/
      http://www.ftools.ca/


_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to