[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?

Thanks
Markus


---------- 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
To:


Issue #19733 has been updated by Markus Neteler.


I suspect that the underscore parsing error happens in

plugins/processing/algs/grass7/Grass7Algorithm.py

around line 553.

----------------------------------------
Bug report #19733: v.rast.stats is broken due to parsing error of double
underscore in column names
http://issues.qgis.org/issues/19733#change-92384

* 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.
number,minimum,maximum,range,average,stddev,variance,coeff_var,sum,first_quartile,median,third_quartile,percentile

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

Log:

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
+towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812
+units=m +no_defs"
v.in.ogr min_area=0.0001 snap=-1
input="/home/user/geodata_dav/mundialis_daten/projekte/who_geodata/data/Districts"
layer=Districts output=tmp15356101025715 --overwrite -o
r.external
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
res=10.0064272109
v.rast.stats -c map="tmp15356101025715" raster="tmp15356101025716"
column_prefix="s" method="third_quartile,percentile" percentile="2"
--overwrite
v.out.ogr --overwrite -s -e input=tmp15356101025715
output="/tmp/processing5113522d9c174e7bb445f24ef38c5f5a/135e78c4ae1d430da568b502506b4ab0"
format=ESRI_Shapefile output_layer=output
[...]
Preprocessing input data...
Processing input data (7 categories)...
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
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)...
7..15..23..30..38..46..53..61..69..76..84..92..100

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


[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:
http://issues.qgis.org/my/account
-------------- 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