[GRASS-dev] Fwd: [QGIS Application - Bug report #19733] v.rast.stats is broken due to parsing error of double underscore in column names

Markus Neteler neteler at osgeo.org
Fri Aug 31 22:58:39 PDT 2018

Hi devs,

does anyone have an idea how to fix this issue in QGIS processing?


---------- Forwarded message ---------
From: <redmine at qgis.org>
Date: Fr., 31. Aug. 2018, 22:38
Subject: [QGIS Application - Bug report #19733] v.rast.stats is broken due
to parsing error of double underscore in column names

Issue #19733 has been updated by Markus Neteler.

I suspect that the underscore parsing error happens in


around line 553.

Bug report #19733: v.rast.stats is broken due to parsing error of double
underscore in column names

* Author: Markus Neteler
* Status: Open
* Priority: Normal
* Assignee:
* Category: Processing/GRASS
* Affected QGIS version: 3.2.2
* Operating System: All
* Pull Request or Patch supplied: No
* Crashes QGIS or corrupts data: No
* Regression?: No
* Easy fix?: No
* Resolution:
Processing > GRASS 7 > v.rast.stats is not functional (reported also in
several forums [1]). The reason is apparently a parse error since column
names have multiple "_". When reducing the statistical measures to those
without underscore (e.g."sum") it works. When having "percentile" is
doesn't since the percentile value is transferred via underscore, e.g.
"percentile=95" becomes "percentile_95" which is not parsed properly in
QGIS processing.

By default all measure are active, i.e.

Issue is in both QGIS 2.18.x as well as 3.2.x.


Algorithmus v.rast.stats - Calculates univariate statistics from a raster
map based on vector polygons and uploads statistics to new attribute
columns. startet...
g.proj -c proj4="+proj=sterea +lat_0=52.15616055555555
+lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel
+units=m +no_defs"
v.in.ogr min_area=0.0001 snap=-1
layer=Districts output=tmp15356101025715 --overwrite -o
input="/home/user/ES5_TemperatureCoolingModul/actualT_dailymean.tif" band=1
output=tmp15356101025716 --overwrite -o
g.region n=322441.565 s=312777.529 e=180172.152 w=172817.428
v.rast.stats -c map="tmp15356101025715" raster="tmp15356101025716"
column_prefix="s" method="third_quartile,percentile" percentile="2"
v.out.ogr --overwrite -s -e input=tmp15356101025715
format=ESRI_Shapefile output_layer=output
Preprocessing input data...
Processing input data (7 categories)...
Updating the database ...
ERROR 6: Failed to add field named 's_third_quartile'
ERROR 6: Failed to add field named 's_percentile_2'
Exporting 13 areas (may take some time)...

Assumed solution: fix the parsing of the column names (allow for multiple

[1] Reported without solution here:
* https://stackoverflow.com/questions/51244882/v-rast-stats-in-qgis-3-2
* https://github.com/jannes-m/RQGIS/issues/99
* ...

You have received this notification because you have either subscribed to
it, or are involved in it.
To change your notification preferences, please click here:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180901/cbe29dc1/attachment.html>

More information about the grass-dev mailing list