[Qgis-user] pyqgis - adding an ogr vector layer and setting where clause

Duarte Carreira DCarreira at edia.pt
Tue Oct 11 03:20:01 PDT 2011


Hi,Germán. I found that just a few hours before I saw your email.

Turns out it doesn't work with the ogr sde driver. It does work with shapefiles though...

Thanks anyway.
Duarte

De: Germán Carrillo [mailto:carrillo.german at gmail.com]
Enviada: segunda-feira, 10 de Outubro de 2011 20:21
Para: Duarte Carreira; qgis-user at lists.osgeo.org
Assunto: Re: [Qgis-user] pyqgis - adding an ogr vector layer and setting where clause

Hi Duarte,

have you tried this?

vLayer.setSubsetString( "id = 5" )

where vLayer is your vector layer object and id is one of the field names in the table.

Regards,

Germán

2011/10/10 Duarte Carreira <DCarreira at edia.pt<mailto:DCarreira at edia.pt>>
Hi there.

I would like to add a layer from an ogr source, and apply a -where option. How can this be done in QGIS through the python API?

I have seen examples of setting a uri string and using addvectorlayer. But this doesn't set a query.

Thanks,
Duarte

_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/qgis-user



--
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20111011/3a48e810/attachment.html>


More information about the Qgis-user mailing list