2

I'm trying to build a plugin for Qgis where I want to use some functions of a default plugin. I would like to control the options that the user are supose to fill in while using the Interpolation plugin.

So far I have only managed to start the plugin in my python code with:

from PyQt4.QtGui import QAction
for item in qgis.utils.plugins['processing'].iface.rasterMenu().actions():
    if "polation" in item.text():
        item.menu().actions()[0].activate(QAction.Trigger)

Now I want to fill in this form with python code: Image of Interpolation plugin

But I can't figure out what I activated with item.menu().actions()[0].activate(QAction.Trigger), I've searched through the children of item.menu().actions()[0] but I can't find any with the title "Interpolation plugin" or anything else on the picture :(

I'd tried item.menu().actions()[0].dumpObjectTree() and got nothing in return..

2

After weeks of trying and multiple tries with different solutions written in scipy, I finally found a working solution!

import processing
GRASS_REGION_PARAMETER = '%f,%f,%f,%f'% (min_lon, max_lon, min_lat , max_lat)
processing.runandload("grass:v.voronoi", path_and_file_name_point,False, False, GRASS_REGION_PARAMETER, -1, 0, 3, path_and_file_name_poly)

I had huge problems with getting the correct format for GRASS_REGION_PARAMETER. I had an extra space in the end which resulted in that no polygon file were created (I wrote "= '%f, %f, %f, %f '%(" etc. instead of "= '%f,%f,%f,%f'%( " etc.)

The only "problem" that remains now are that it takes rather long time to run the process with 100k+ points.

0

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.