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

Germán Carrillo carrillo.german at gmail.com
Mon Oct 10 12:20:54 PDT 2011


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>

> 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
> 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/20111010/0ec17640/attachment.html>


More information about the Qgis-user mailing list