[Qgis-developer] Select all elements in the view ...

Geo DrinX geodrinx at gmail.com
Thu Oct 24 03:11:20 PDT 2013


Hello all again,

>From PyQgis, I need to export (to my own format) only the elements
contained in the QGis view.

So, I taken the canvas coordinates and I created a string that has the
"expression" syntax:

                text = self.iface.mapCanvas().extent().toString()
                text1 = text.replace("," , " ")
                text2 = text1.replace(" : ", ",")
                text = "bbox($geometry, geomFromWKT ( 'LINESTRING(" + text2
+ ")'))"


There is a way to applicate the bbox filter during the scanning of the
elements, that is during:

                    iter = layer.getFeatures()
                    for feat in iter:

...or, need I to filter elements from myself ?

It will be only in 2.2 version ?

Thank you for any info about this

Roberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131024/7e6d0880/attachment.html>


More information about the Qgis-developer mailing list