Thanks for your help. Using QgsVectorLayer worked straight away to give the
handle from the source files.
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?

Cheers and thanks
Ole



On Fri, Dec 9, 2011 at 6:45 PM, Alexander Bruy <alexander.b...@gmail.com>wrote:

> Hi Ole,
>
> 2011/12/9 Ole Nielsen <ole.moller.niel...@gmail.com>:
> > With that loaded layer names show up in the combo and after selection the
> > fully qualified filename is returned by layer.source()
> >
> > However, if I want a handle to an active layer, like I got
> > with self.iface.mapCanvas().currentLayer() is there any way that could be
> > obtained from the layer object?
>
> as I see you use code from Giuseppe. If you want to get
> layer object use my function or modify your existing code.
> You need to create a QgsVectorLayer object from layer's
> source.
>
> --
> Alexander Bruy
> NextGIS
>
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to