Thanks for your help. Using QgsVectorLayer worked straight away to give the handle from the source files.<div>I assume OgsRasterLayer will work the same way. I can use the file name extension to determine if the file is raster or vector but was wondering if Qgis has a library for that too?</div>
<div><br></div><div>Cheers and thanks</div><div>Ole <br><div><br><div><br><br><div class="gmail_quote">On Fri, Dec 9, 2011 at 6:45 PM, Alexander Bruy <span dir="ltr">&lt;<a href="mailto:alexander.bruy@gmail.com">alexander.bruy@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ole,<br>
<br>
2011/12/9 Ole Nielsen &lt;<a href="mailto:ole.moller.nielsen@gmail.com">ole.moller.nielsen@gmail.com</a>&gt;:<br>
<div class="im">&gt; With that loaded layer names show up in the combo and after selection the<br>
&gt; fully qualified filename is returned by layer.source()<br>
&gt;<br>
&gt; However, if I want a handle to an active layer, like I got<br>
&gt; with self.iface.mapCanvas().currentLayer() is there any way that could be<br>
&gt; obtained from the layer object?<br>
<br>
</div>as I see you use code from Giuseppe. If you want to get<br>
layer object use my function or modify your existing code.<br>
You need to create a QgsVectorLayer object from layer&#39;s<br>
source.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Alexander Bruy<br>
NextGIS<br>
</font></span></blockquote></div><br></div></div></div>