Bug report #21751

r.quantile doesn't work when called from qgis

Added by Daniel Morton 12 months ago. Updated 12 months ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GRASS
Affected QGIS version:3.4.6 Regression?:No
Operating System:windoze Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29566

Description

The grass arguments constructed by qgis have an error, so quantiles are not calculated. This applies to all versions since and including 3.4.6 LTR

Processing algorithm…
Algorithm 'r.quantile' starting…
Input parameters: { '-r' : False, 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'bins' : 1000000, 'html' : 'C:/Users/danm/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/outputs/report.html', 'input' : 'E:/work/PASSES/output442eafcacec44453adacaabf1318a15a.1.tif', 'percentiles' : '', 'quantiles' : 50 }

g.proj c proj4="+proj=longlat +datum=WGS84 +no_defs"
r.external input="E:\work\PASSES\output442eafcacec44453adacaabf1318a15a.1.tif" band=1 output="rast_5ca4cf97be96e2" --overwrite -o
g.region n=1.0332871555555554 s=-0.3229443447222222 e=102.42590869527778 w=101.07866034805555 res=0.00022457882100720682
r.quantile input=rast_5ca4cf97be96e2 quantiles=50 bins=1000000 html=
> "C:/Users/danm/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/outputs/report.html" --overwrite
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Executing <C:\Users\danm\AppData\Local\Temp\processing_97caa1fd8ae04659b492832728037cb5\grassdata\grass_batch_job.cmd> ...
C:\Windows\System32>chcp 1252 1>NUL
C:\Windows\System32>g.proj c proj4="+proj=longlat +datum=WGS84 +no_defs"
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Projection information updated
C:\Windows\System32>r.external input="E:\work\PASSES\output442eafcacec44453adacaabf1318a15a.1.tif" band=1 output="rast_5ca4cf97be96e2" --overwrite -o
Over-riding projection check
Reading band 1 of 1...
Link to raster map <rast_5ca4cf97be96e2> created.
C:\Windows\System32>g.region n=1.0332871555555554 s=-0.3229443447222222 e=102.42590869527778 w=101.07866034805555 res=0.00022457882100720682
C:\Windows\System32>r.quantile input=rast_5ca4cf97be96e2 quantiles=50 bins=1000000 html=
--overwrite 1>"C:/Users/danm/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/outputs/report.html"
Compute quantiles using two passes.
Usage:
r.quantile [-r] input=name [quantiles=value]
[percentiles=value[,value,...]] [bins=value] [file=name] [--overwrite]
[--help] [--verbose] [--quiet] [--ui]
Flags:
r Generate recode rules based on quantile-defined intervals
Parameters:
input Name of input raster map
quantiles Number of quantiles
default: 4
percentiles List of percentiles
bins Number of bins to use
default: 1000000
file Name for output file (if omitted or "
" output to stdout)
ERROR: r.quantile: Sorry, <html> is not a valid parameter
C:\Windows\System32>exit
Execution of <C:\Users\danm\AppData\Local\Temp\processing_97caa1fd8ae04659b492832728037cb5\grassdata\grass_batch_job.cmd> finished.
Cleaning up temporary files...
Press any key to continue . . .
Execution completed in 38.62 seconds
Results: {'html': 'C:/Users/danm/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/outputs/report.html'}

Associated revisions

Revision f1dbcc3c
Added by Jürgen Fischer 12 months ago

processing: fix grass' r.quantile parameter (fixes #21751)

Revision c7a7b293
Added by Jürgen Fischer 12 months ago

processing: fix grass' r.quantile parameter (fixes #21751)

(cherry picked from commit f1dbcc3c53c8bc612bb29c60f75b6f403f3f65cc)

Revision ff166628
Added by Jürgen Fischer 12 months ago

backports
c77e393ea4 legend: truncate excessively long tooltips (fixes #21737)
88513284d4 fix removal of temporary directories (fixes #21292)
95bd7480d0 postgres provider: use st_estimatedextent only when 'use estimated metadata' is enabled (fixes #21718)
f1dbcc3c53 processing: fix grass' r.quantile parameter (fixes #21751)
c6382553cd don't relink object if just the shared objects/DLL is changed
9aaaad3ab8 trim crssync include directories (followup 8851328)

History

#1 Updated by Pedro Venâncio 12 months ago

I confirm this issue.

The parameter html in

https://github.com/qgis/QGIS/blob/580e7eb6ba4e7a88a6d470f2907350c57f6c2907/python/plugins/processing/algs/grass7/description/r.quantile.txt#L9

should be file

QgsProcessingParameterFileDestination|file|Quantiles|Html files (*.html)|report.html|False

https://grass.osgeo.org/grass76/manuals/r.quantile.html

#2 Updated by Jürgen Fischer 12 months ago

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

Also available in: Atom PDF