[Qgis-user] Retrieve in python api the list of layers in a project

Jorge Tornero jtorlistas at gmail.com
Wed Jun 25 08:48:58 PDT 2014


As a quick and dirty answer, look for information regardung qgslayerregistry


In my plugin transectizer I iterate through the lsyers, yo can  check the
source code in github and loolk in transectizer.py in the function
populateLayersCombo and see it that fits your  needs

I,'m pretty sure it doesn't mess with grup but just with layers.

Sorry for tthe t?yping... this sparrow-sized keyboard of my mobile phone
and travelling by bus are not compatible wihh my big-guy sized fingers...

All the best

Jorge Tornero



El miércoles, 25 de junio de 2014, Andrea Peri <aperi2007 at gmail.com>
escribió:
> Hi,
>
> In API python there a method to retrieve the list of all the layers in
> the project ?
>
> I check in the API and find the
> qgis.core.QgsMapLayer
> but it is the single layer.
>
> Also I find the
> qgis.core.QgsLayerTree
>
> But it seem not only layers but also groups.
> There is a container for all and only layers ?
>
> Thx,
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140625/93ffb337/attachment.html>


More information about the Qgis-user mailing list