qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.61k stars 3.01k forks source link

processing: grass7 algorithms broken, (falsely) claims grass7 not installed #23636

Closed qgib closed 5 years ago

qgib commented 8 years ago

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV) Original Redmine Issue: 15713 Affected QGIS version: master Redmine category:processing/core Assignee: Victor Olaya


For ~1 week now, I can't execute any grass7 algorithm within processing. When I try to do so, I can an error message telling me Grass7 is not installed, which is incorrect,

Looking into the code a bit, I realized the "grass7 not installed" message is triggered whenever a test runalg() fails (in Grass7Utils.py). The test is as follow:

runalg(
                'grass7:v.voronoi',
                points(),
                False,
                False,
                '270778.60198,270855.745301,4458921.97814,4458983.8488',
                -1,
                0.0001,
                0,
                None,
            )

Running this test manually, the failure here is not due to missing Grass7, but to the number of arguments provided != (alg.getVisibleParametersCount() + alg.getVisibleOutputsCount())

This is what I get if I the runalg() test in python console:

Error: Wrong number of parameters
ALGORITHM: v.voronoi - Creates a Voronoi diagram from an input vector layer containing points.
    input <ParameterVector>
    -l <ParameterBoolean>
    -t <ParameterBoolean>
    GRASS_REGION_PARAMETER <ParameterExtent>
    GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
    GRASS_MIN_AREA_PARAMETER <ParameterNumber>

Looking into value for variables at play here, I get:

So indeed, 8 != 6, which throws an error that ends up being (mis-)interpreted as me not having Grass7 installed.

Victor, hopefully this time it's not a bigger-than-processing issue ;)

qgib commented 8 years ago

Author Name: Victor Olaya (@volaya)


25d0351 should fix it

Please confirm and close the ticket

Thanks for the report!

qgib commented 8 years ago

Author Name: Alexander Bruy (@alexbruy)


qgib commented 8 years ago

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)


All good now. Thanks again Victor.