<div dir="ltr"><a href="http://layer.id">layer.id</a>() returns the id<div><br></div><div><a href="http://qgis.org/api/classQgsMapLayer.html#a710f27dec806d3bcd5ae14701c2e6fd7">http://qgis.org/api/classQgsMapLayer.html#a710f27dec806d3bcd5ae14701c2e6fd7</a></div><div><br><div><a href="http://layer.name">layer.name</a>() returns the name</div><div><br></div><div><a href="http://qgis.org/api/classQgsMapLayer.html#aff7fb3990b6c736fbe41643666b027e5">http://qgis.org/api/classQgsMapLayer.html#aff7fb3990b6c736fbe41643666b027e5</a><br></div><div><br></div><div>If you have a layerid and you want to look up the layer object for it you can use:</div><div><br></div><div>QgsMapLayerRegistry.instance().mapLayers[layerid]</div><div><br></div><div>if you have a name and would like the layers objects:</div><div><br></div><div>maplayers = QgsMapLayersRegistry.instance().mapLayersByName(name)</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 9:38 PM, walter.nordmann <span dir="ltr"><<a href="mailto:walter.nordmann@web.de" target="_blank">walter.nordmann@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nathan Woodrow wrote<br>
<span class="">> Try this:<br>
><br>
> maplayers = QgsMapLayerRegistry.instance().mapLayers()<br>
><br>
> maplayers will be a dict of layerid-layer object<br>
<br>
</span>and than? i'm new to qgis programming and the documentation is not very<br>
helpfull :(<br>
<br>
Please no breadcrombs. Trying to solve this little problem for 2 day now :(<br>
<br>
should be something like layer.getId() but i can't find it.<br>
<br>
Regards<br>
walter<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Get-layer-id-by-layer-not-by-acive-layer-tp5167152p5167195.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Get-layer-id-by-layer-not-by-acive-layer-tp5167152p5167195.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Quantum GIS - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</div></div></blockquote></div><br></div>