Bug report #19433

"List of contour levels" field in GRASS r.contour is mandatory, shouldn't be

Added by Michel Gouédard over 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:Giovanni Manghi
Category:Processing/GRASS
Affected QGIS version:3.2 Regression?:No
Operating System:Windows 7 64bits SP1 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27261

Description

Hi,

When starting r.contour from the GRASS group on a raster with "Increment between contour levels", "Maximum contour level" and "Minimum contour level" fields filled out, but "List of contour levels" left blank, I get the "Wrong Parameter Value" error on the latter field.
[screenshot joined]

However, the 7.4 GRASS documentation states :

Contours can be produced using a comma-separated list of values in levels, or at some regular increment using the step parameter, using minlevel and maxlevel as minimum and maximum contour values, respectively. If no minlevel or maxlevel is specified, the minimum and maximum cell values in the input raster map will be used.

and

r.contour will either step through incremental contours or produce contours from a list of levels, not both. If both a list of levels and a step are specified, the list will be produced and the step will be ignored.

I get from this that it should be allowed to enter Step only, without List nor MinMax, or Step and MinMax without List.

Python version : 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
Qgis version : 3.2.0-Bonn, bc43194061
GRASS version : GRASS 7 version 2.0 (as displayed in Plugins-> Installed), 7.4.1 (as seen in OSGeo4W setup)

qgis_issues_rcontour_error.png (60.6 KB) Michel Gouédard, 2018-07-17 02:21 PM

History

#1 Updated by amedeo fadini about 6 years ago

Michel Gouédard wrote:

Hi,

When starting r.contour from the GRASS group on a raster with "Increment between contour levels", "Maximum contour level" and "Minimum contour level" fields filled out, but "List of contour levels" left blank, I get the "Wrong Parameter Value" error on the latter field.

I confirm the problem in 3.2 Debian stretch, too.

Amedeo

#2 Updated by amedeo fadini about 6 years ago

I've tried to changhe this line in python/plugins/processing/algs/grass7/description/r.contour.txt

From:

QgsProcessingParameterString|levels|List of contour levels|None|False

to:

QgsProcessingParameterString|levels|List of contour levels|None|False|True

For me it works

Amedeo

#3 Updated by Giovanni Manghi about 6 years ago

  • Assignee set to Giovanni Manghi

#4 Updated by Giovanni Manghi about 6 years ago

amedeo fadini wrote:

I've tried to changhe this line in python/plugins/processing/algs/grass7/description/r.contour.txt

From:

QgsProcessingParameterString|levels|List of contour levels|None|False

to:

QgsProcessingParameterString|levels|List of contour levels|None|False|True

For me it works

Amedeo

PR here
https://github.com/qgis/QGIS/pull/8102

#5 Updated by Nyall Dawson about 6 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Fixed in master

Also available in: Atom PDF