Bug report #19186

GRASS module (v.net.steiner) works in QGIS2 but not in QGIS3

Added by Sophie Crommelinck over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Processing/GRASS
Affected QGIS version:3.0.3 Regression?:No
Operating System:Windows Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:27015

Description

I wrote the following to the GRASS user mailing list and was advised by Markus Neteler to open a QGIS bug report and point out that a bug might be in the following file: https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/grass7/description/v.net.steiner.txt.

Here the problem description:
I am unable to figure out why a certain processing algorithm (v.net.steiner) works fine in QGIS2, but not in QGIS3. I am using the same line and point layer with the same cost column. The input data as well as the cost column are the only parameters that I define, the others remain the default ones.

In QGIS2 the processing history looks like this:

processing.runalg("grass7:v.net.steiner","C:/xxx/linesLayer.shp","C:/xxx/nodeLayer.shp",50,2,"1-100000","boundary",-1,False,"794057.939937,794307.889937,9833916.58837,9834082.13837",-1,0.0001,0,None)

The result looks fine connecting the 3 nodes via the line layer:
!!

In QGIS3 the processing history looks like this:

processing.run("grass7:v.net.steiner", {'input':'C:/xxx/linesLayer.shp','points':'C:/xxx/nodeLayer.shp','threshold':50,'arc_type':[0,1],'terminal_cats':'1-100000','acolumn':'boundary','npoints':-1,'-g':False,'output':'G:/1_QGIS_Temp_files/processing_f8ef30794232406cb21d5d7cc1d06809/4774808dfe284dafafd9a15a9879a5c1/output.shp','GRASS_REGION_PARAMETER':None,'GRASS_SNAP_TOLERANCE_PARAMETER':-1,'GRASS_MIN_AREA_PARAMETER':0.0001,'GRASS_OUTPUT_TYPE_PARAMETER':0})

The changed syntax in the history of QGIS2 and QGIS3 adds the parameter names to the history, which is a visual change only, while the parameters in both calls remain the same.

No result is created. The error messages indicate that the point layer cannot be used. However, the module has no points parameter (https://grass.osgeo.org/grass74/manuals/v.net.steiner.html):

FEHLER: v.net.steiner: Sorry, <points> is not a valid parameter

Importing the data to GRASS7 directly and running v.net.steiner there indicates the same, as I get the following error message:

Number of terminals: 0, ERROR: Nicht genügend Stationen (< 2)

I uploaded the subset of the line and point layer that I used here (https://share4land.itc.utwente.nl:5566/sharing/pfjsbL9G8).

Both QGIS2 and QGIS3 versions use GRASS7.4.

Capture.JPG - successful v.net.steiner result in QGIS2 (15.1 KB) Sophie Crommelinck, 2018-06-13 08:09 AM

Associated revisions

Revision 28c4a6cf
Added by Nyall Dawson over 6 years ago

[processing][grass] Fix v.net.* output types, add tests

Fixes #19186

Revision a1015623
Added by Nyall Dawson over 6 years ago

[processing][grass] Fix v.net.* output types, add tests

Fixes #19186

(cherry-picked from 28c4a6cf5)

History

#1 Updated by Nyall Dawson over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF