[Qgis-developer] processing.runalg() issue with grass algorithms

Eric Goddard egoddard1010 at gmail.com
Sat Mar 15 23:21:50 PDT 2014


Hi all,

I'm using QGIS 2.3-Master 64-bit, fa157b0 with GRASS 6.4.4svn on linux.

When I pass a grass command to processing.runalg() without specifying
the GRASS_REGION_PARAMETER or GRASS_REGION_CELLSIZE_PARAMETER, I get
an empty output because the region/cell size are invalid. For example,
using the qgis sample data, if I run:

lpf = processing.runalg("grass:r.neighbors", "SR_50M_alaska_nad", 0,
9, False, False, None, None, None, None)

there is an output key in lpf that points to a tif, but that tif
doesnt exist. Looking at the log, the above command is translated to:

processing.runalg("grass:r.neighbors","/data/GIS/qgis_sample_data/raster/SR_50M_alaska_nad.tif",0,9,False,False,"None","0,1,0,1",0.0,None)

If one runs the r.neighbors algorithm from the Processing Toolbox,
leaving the region and cell size at the defaults (blank and 0.00)
works correctly. How can a similar behavior be achieved  when running
the command through processing.runalg()?

And on a somewhat related note, when running a grass algorithm from
the toolbox there is an option to select extent on canvas--can this be
used in custom processing scripts?

Thanks!
Eric


More information about the Qgis-developer mailing list