-
-
Notifications
You must be signed in to change notification settings - Fork 412
Description
Describe the bug
After updating QGIS LTR from 3.34.9 to 3.34.10 grass7:v.rast.stats does not calculate univariate statistics from a raster map based on vector polygons. Instead of uploading statistics to new attribute columns, grass7:v.rast.stats returns these new attributes with only NULL s as sole value. Further updating to QGIS LTR 3.34.11 hasn’t helped to overcome this issue. While running grass7:v.rast.stats with a parallel installed QGIS version 3.34.9 works fine.
My operating system is Windows 10.
I’ve raised this as a QGIS-issue and I’ve been told that this issue is not due to QGIS itself (s. here). Furthermore, the response to my QGIS-issue states, that this issue also occurs even directly using GRASS-GIS 8.4.0 installed by the OSGeo4W installer for QGIS 3.34.11 on Windows 10. And thus I’ve been advised to report this issue as bug here.
To reproduce
- Go to https://github.com/qgis/QGIS-Sample-Data
- Download QGIS-Sample-Data-master.zip on the computer where you have QGIS 3.34.11 installed
- unzip QGIS-Sample-Data-master.zip --> QGIS-Sample-Data-master
- Open QGIS 3.34.11 and start a new project
- Go within folder QGIS-Sample-Data-master to
~\qgis_sample_data\shapefiles\lakes.shp and ~\qgis_sample_data\raster\SR_50M_alaska_nad.tif. Drag and drop these two files / layers into the new QGIS project you just started - Open the Processing Toolbox and search for v.rast.stats
- Open v.rast.stats set lakes as vector input and SR_50M_alaska_nad as raster input, specify column prefix, optionally select 1 or more methods and change percentile. Leave Advanced Parameters as they are.

- Press the Run button and wait until
grass7:v.rast.statshas finished. The log should reveal some error:
log_file_v.rast.stats_QGIS_3.34.11.txt
Importing raster map <rast_66feb3cbb3a5b3>...
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
c:\Users\loc-bia3\Documents>g.region n=9275122.968681416 5=-735684.661767209 e=6363148.437637258 w=-6232946.672697669 res=7181.354110795283
c: \Users\loc-bia3\Documents>v.rast.stats -c map=vector_66feb3cbb3a5b2 raster=rast_
_66feb3cbb3a5b3 column_prefix="rs" method="maximum, percentile"
percentile=80 --overwrite
Processing input data (15 categories)...
WARNING: LZ4 decompression error
WARNING: LZ4 decompression error
2. WARNING: ZSTD compression error -10: Unknown frame descriptor
ERROR: Error uncompressing null data for row 8 of <rast_66feb3cbb3a5b3>
WARNING: ZSTD compression error -72: Src size is incorrect
Updating the database
WARNING: Concurrent mapset locking is not supported on Windows iden
C: \Users\loc-bia3\Documents>chcp 1252 1>NUL Warning 1: Layer 'vector 66feb3cbb3a5b2' has been declared with non-z geometry type Polygon, but it does contain geometries with Z. Setting the
z=2 hint into gpkg_geometry_columns
WARNING: Vector map <vector_66feb3cbb3a5b2> is 3D. Use format specific layer creation options (parameter 'Ico') to export in 3D rather than 2D (default).
X. 12 18 024. 305. 30 Ye 54 20 66 72 78. 84.90..96..100 WARNING: 68 features without category were skipped. Features without category are written only when -c flag is given.
v.out.ogf complete. 15 features (Polygon type) written to ‹vector_66feb3cbb3a5b2> (GPKG format) .
c: \Users\loc-bia3\Documents>exit Execution completed in 2.55 Sekunden
Ergebnisse:
¡'output': <gsProcessingOutputLayerDefinition ('sink':TEMPORARY_OUTPUT, 'createoptions': ('fileEncoding': 'windows-1252'})>}
Lade Ergebnis Layer
Algorithmus 'v.rast.stats' beendet
- Inspect attribute table of
grass7:v.rast.stats' s output Rast stats . The new statistic-attributes only consist of NULL s:
Expected behavior
s. above To reproduce step 8. & 9.
Screenshots
s. above To reproduce
System description
- Operating System: [Windows 10]
- GRASS GIS version: [8.4.0]
- for details about the involved QGIS version look at the Versions section in the raised QGIS-issue
- details about further software components: the log returned when running
grass7:v.rast.statswith QGIS 3.34.11 (s. above To reproduce step 8.) list in the frist lines these software components:
QGIS-Version: 3.34.11-Prizren
QGIS-Codeversion: 2904bcec
Qt-Version: 5.15.13
Python-Version: 3.12.6
GDAL-Version: 3.9.2
GEOS-Version: 3.12.2-CAPI-1.18.2
PROJ-Version: Rel. 9.4.0, March 1st, 2024
PDAL-Version: 2.6.3 (git-version: b5523a)
GRASS-Version: 8.4.0
Additional context
When running grass7:v.rast.stats on QGIS 3.34.10 or QGIS 3.34.11 (on Windows 10) with different inputs I’ve seen varying error messages returned by the log. But the one thing that was consistent, was that returned statistics attributes only included NULL s.