[QGIS-Developer] PyQGIS: Check if layer is already loaded?

2017-06-04 Thread Magnus Homann
I'm writing a plugin that adds feature to a SHP-layer, specified as a filename. If the layer already is loaded in Qgis, I want to check for and use the loaded layer instead of creating a new from the same SHP-file. Is this even possible? ___

Re: [QGIS-Developer] PyQGIS: Check if layer is already loaded?

2017-06-04 Thread Siki Zoltan
Dear Magnus. you can iterate through the layers: for lay in QgsMapLayerRegistry.instance().mapLayers().values(): if lay.name() == your_layer_name: your layer is loaded Regards, Zoltan On Sun, 4 Jun 2017, Magnus Homann wrote: I'm writing a plugin that adds feature to a SHP-layer,

Re: [QGIS-Developer] [Qgis-developer] Are there plans to create a unique "Add layer" tool?

2017-06-04 Thread Stéphane Henriod
Hi Alessandro I just downloaded the latest nightly build and will make some tests in the coming days. What would be the most efficient / useful way to give you feedback and comments? On this thread? Thanks and cheers Stéphane Le jeudi 1 juin 2017, Alessandro Pasotti a