3

I am trying to use GRASS algorithms in a plugin of mine, in order to improve the quality of a shapefile containing lines that will be used as a graph later. The first algorithm I want to use is the one that breaks the lines at their intersections : v.clean.break.

path_to_broken_lines = processing.runalg(
 "grass:v.clean", #Algorithm name
 input, #Path to the layer to break
 0, #Tool (0<=>break)
 0, #Threshold (not needed for this algorithm)
 "%f , %f, %f, %f "% (xmin , xmax , ymin , ymax), #GRASS_REGION_PARAMETER <ParameterExtent>
 -1, #GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
 0, #GRASS_MIN_AREA_PARAMETER <ParameterNumber>
 None, #Errors file (None <=> temporary file)
 None) #Output file path (None <=> temporary file)

Now, despite being the admin of my computer, I get an error saying that my company's policy is blocking the execution of the algorithm. Still, I can execute them manually by running the GRASS plugin, importing my file into grass (v.in.ogr) and using the algorithm afterwards, but it seems like I can't automate it.

My question is the following : is there a way to use "processing.runalg()" as admin ? I have found ways to execute shell scripts as an admin but it is not really the same problem, is it. The plugin would work if I launched QGIS as an administrator, but I do not really want to force the end users to launch QGIS as an admin just to be able to run a plugin they won't use daily.

asked Jul 1, 2016 at 8:11

1 Answer 1

1

Have you tried processing.runandload() ?

I'm using that when I run a grass:v.voronoi function and that works fine.

answered Jul 24, 2016 at 21:46
1
  • I've just tried it, unfortunately it doesn't work. It is the same error. I wonder how I can use the algorithm manually, but get blocked when trying to automate it, it makes no sense. :( Commented Jul 26, 2016 at 7:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.