I'm currently writing a python plugin where I would like user with 0 experience of GIS to use QGIS to view data geographically anyhow,

I'm running two processing functions:

import processing
processing.runandload('qgis:reprojectlayer', str(self.input_file_path) + "shapefiles/temp.shp",'EPSG:4326', file_name + '.shp')
processing.runandload("grass:v.voronoi", file_name+".shp",False, True, extent, -1, 0, 3, file_name_poly)

Both of them are adding the new layer in qgis "Layers Panel", can I turn this off? (and just saving the files in the selected path). Now I got one layer called Reprojected and one called Voronoi Polygons in the Layer Panel.

  • You mean turn off visibility or you want to do changes on same shape files ? – Shiko Aug 3 '16 at 4:59
  • I don't want them to appear in the layer list, sorry for being unclear! – axel_ande Aug 3 '16 at 9:07

You can replace the runandload function with runalg if you don't want the output to be shown. So your code will look like:

import processing
processing.runalg('qgis:reprojectlayer', str(self.input_file_path) + "shapefiles/temp.shp",'EPSG:4326', file_name + '.shp')
processing.runalg("grass:v.voronoi", file_name+".shp",False, True, extent, -1, 0, 3, file_name_poly)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.