3

I want to use the GRASS tool v.rast.stats for extracting information from raster data. I need average, mean, number etc. for each of the 15 polygons.

When I run the tool, following message appears at the end of the log: "The following layers were not correctly generated. - Rast stats"

Am using GRASS 7 with QGIS 2.18.5.

Just in case, I'll copy the whole log, even if it doesn't make any sense to me ;-) Anyone got a clue what went wrong?

*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=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs"
v.in.ogr min_area=0.0001 snap=-1 input="C:/Masterarbeit/Data/Images/QGIS" layer=gravel bar are 04 output=tmp1499246114155 --overwrite -o
r.external input="C:/Masterarbeit/flood simulations/hdr912.tif" band=1 output=tmp1499246114156 --overwrite -o
g.region n=127848.576 s=125922.576 e=695033.429 w=691297.429 res=2.0
v.rast.stats -c map="tmp1499246114155" raster="tmp1499246114156" column_prefix="FR" method="number,minimum,maximum,range,average,stddev,variance,coeff_var,sum,first_quartile,median,third_quartile,percentile" percentile="90" --overwrite
v.out.ogr -s -e input=tmp1499246114155 output="C:\Users\GREGOR~1\AppData\Local\Temp\processing0a9b71eb1386424a82b45af78aa98c7b\08601010edb84d7093d5526d0fb0a7af" format=ESRI_Shapefile output_layer=output
C:\Program Files\QGIS 2.18\bin>set HOME=C:\Users\Gregor Zahn 
C:\Program Files\QGIS 2.18\bin>set GISRC=C:\Users\Gregor Zahn\.qgis2\\processing\processing.gisrc7 
C:\Program Files\QGIS 2.18\bin>set WINGISBASE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0 
C:\Program Files\QGIS 2.18\bin>set GISBASE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0 
C:\Program Files\QGIS 2.18\bin>set GRASS_PROJSHARE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\share\proj 
C:\Program Files\QGIS 2.18\bin>set GRASS_MESSAGE_FORMAT=plain 
C:\Program Files\QGIS 2.18\bin>if "" == "" set PATH=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg\shapely\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\numpy\core;C:\PROGRA~1\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\Python27\Scripts;C:\PROGRA~1\QGIS2~1.18\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\WBem 
C:\Program Files\QGIS 2.18\bin>if not "" == "" set PATH=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg\shapely\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\numpy\core;C:\PROGRA~1\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\Python27\Scripts;C:\PROGRA~1\QGIS2~1.18\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\WBem 
C:\Program Files\QGIS 2.18\bin>set GRASS_VERSION=7.2.0 
C:\Program Files\QGIS 2.18\bin>if not "" == "" goto langset 
C:\Program Files\QGIS 2.18\bin>FOR /F "usebackq delims==" %i IN (`"C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\winlocale"`) DO @set LANG=%i 
C:\Program Files\QGIS 2.18\bin>set PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY 
C:\Program Files\QGIS 2.18\bin>set PYTHONPATH=;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\python;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\wxpython\n 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="MAPSET=PERMANENT" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="LOCATION=temp_location" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="LOCATION_NAME=temp_location" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="GISDBASE=C:\Users\GREGOR~1\AppData\Local\Temp\processing0a9b71eb1386424a82b45af78aa98c7b\grassdata" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="GRASS_GUI=text" 
C:\Program Files\QGIS 2.18\bin>g.proj -c proj4="+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs" 
Die Standard Region wurde auf die neue Projektion aktualisiert. Wenn Sie aber mehrere Mapsets haben, sollten Sie `g.region -d` in jedem ausführen, um die Einstellungen von der Standardregion zu übernehmen. 
Projektionsinformationen aktualisiert 
C:\Program Files\QGIS 2.18\bin>v.in.ogr min_area=0.0001 snap=-1 input="C:/Masterarbeit/Data/Images/QGIS" layer=gravel bar are 04 output=tmp1499246114155 --overwrite -o 
Beschreibung: 
Imports vector data into a GRASS vector map using OGR library. 
Schlüsselwörter: 
Vektor, Import, OGR 
Benutzung: 
v.in.ogr [-flc2tojrewi] input=string [layer=string[,string,...]] 
[output=name] [spatial=xmin,ymin,xmax,ymax[,xmin,ymin,xmax,ymax,...]] 
[where=sql_query] [min_area=value] [type=string[,string,...]] 
[snap=value] [location=name] [columns=name[,name,...]] 
[encoding=string] [key=string] [geometry=name] [--overwrite] [--help] 
[--verbose] [--quiet] [--ui] 
Schalter: 
-f List supported OGR formats and exit 
-l List available OGR layers in data source and exit 
-c Polygone nicht säubern (clean) (nicht empfehlenswert). 
-2 Force 2D output even if input is 3D 
Useful if input is 3D but all z coordinates are identical 
-t Do not create attribute table 
-o Übersteuere die Projektionsprüfung (verwende Projektion der Location) 
Assume that the dataset has the same projection as the current location 
-j Perform projection check only and exit 
-r Begrenze den Import auf die aktuelle Region. 
-e Vergrößere die Ausdehnung der Region basierend auf neuem Datensatz. 
Aktualisiere die Standard-Region auch wenn im Mapset PERMANENT. 
-w Ändere Spaltenname zu Kleinbuchstaben 
-i Create the location specified by the "location" parameter and exit. Do not import the vector data. 
--o Ausgabedateien dürfen bereits existierende Dateien überschreiben. 
--h Print usage summary 
--v Ausführlicher Ausgabemodus 
--q Schweigsamer Ausgabemodus 
--qq Super quiet module output 
--ui Force launching GUI dialog 
Parameter: 
input Name of OGR datasource to be imported 
Beispiele: 
ESRI Shapefile: Verzeichnis, welches die Shapefiles beinhaltet. 
MapInfo Datei: Verzeichnis, welches die MapInfo-Dateien enthält. 
layer Name des OGR-Layers. Wenn nicht spezifiziert, werden alle verfügbaren Layer importiert. 
Beispiele: 
ESRI Shapefile: Name des Shapefiles 
MapInfo Datei: Mapinfo-Dateiname. 
output Name der Ausgabe-Vektorkarte 
spatial Importiere nur einen Ausschnitt. 
Format: xmin,ymin,xmax,ymax - gewöhnlich W,S,O,N 
where WHERE Bedingungen des SQL-Ausdrucks ohne das Schlüsselwort 'where'. 
Beispiel: Einkommen = 10000 
min_area Minimum size of area to be imported (square meters) 
Kleinere Flächen und Inseln werden ignoriert. Sollte größer sein als snap^2. 
Standard: 0.0001 
type Optionalerweise: Ändere den Standard Input-Typ. 
Optionen: point,line,boundary,centroid 
Standard: 
point: import area centroids as points 
line: import area boundaries as lines 
boundary: import lines as area boundaries 
centroid: import points as centroids 
snap Snapping threshold for boundaries (map units) 
'-1' für kein Fangen 
Standard: -1 
location Name der neu zu erstellenden Location. 
columns Zeige sie Spaltennamen die anstatt der Originalnamen verwendet werden. Der Erste entspricht der Kategoriespalte. 
encoding Encoding value for attribute data 
Overrides encoding interpretation, useful when importing ESRI Shapefile 
key Name of column used for categories 
If not given, categories are generated as unique values and stored in 'cat' column 
geometry Name of geometry column 
If not given, all geometry columns from the input are used 
FEHLER: Tut mir leid, ist keine gültige Option 
FEHLER: Tut mir leid, ist keine gültige Option 
FEHLER: Tut mir leid, ist keine gültige Option 
C:\Program Files\QGIS 2.18\bin>r.external input="C:/Masterarbeit/flood simulations/hdr912.tif" band=1 output=tmp1499246114156 --overwrite -o 
WARNUNG: Übersteuere die Überprüfung der Projektion. 
Reading band 1 of 1... 
r.external komplett. Link to raster map created. 
C:\Program Files\QGIS 2.18\bin>g.region n=127848.576 s=125922.576 e=695033.429 w=691297.429 res=2.0 
C:\Program Files\QGIS 2.18\bin>v.rast.stats -c map="tmp1499246114155" raster="tmp1499246114156" column_prefix="FR" method="number,minimum,maximum,range,average,stddev,variance,coeff_var,sum,first_quartile,median,third_quartile,percentile" percentile="90" --overwrite 
FEHLER: Vector map not found in current mapset 
C:\Program Files\QGIS 2.18\bin>set HOME=C:\Users\Gregor Zahn 
C:\Program Files\QGIS 2.18\bin>set GISRC=C:\Users\Gregor Zahn\.qgis2\\processing\processing.gisrc7 
C:\Program Files\QGIS 2.18\bin>set WINGISBASE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0 
C:\Program Files\QGIS 2.18\bin>set GISBASE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0 
C:\Program Files\QGIS 2.18\bin>set GRASS_PROJSHARE=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\share\proj 
C:\Program Files\QGIS 2.18\bin>set GRASS_MESSAGE_FORMAT=plain 
C:\Program Files\QGIS 2.18\bin>if "" == "" set PATH=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg\shapely\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\numpy\core;C:\PROGRA~1\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\Python27\Scripts;C:\PROGRA~1\QGIS2~1.18\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\WBem 
C:\Program Files\QGIS 2.18\bin>if not "" == "" set PATH=C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg\shapely\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\numpy\core;C:\PROGRA~1\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\lib;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\bin;C:\PROGRA~1\QGIS2~1.18\apps\Python27\Scripts;C:\PROGRA~1\QGIS2~1.18\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\WBem 
C:\Program Files\QGIS 2.18\bin>set GRASS_VERSION=7.2.0 
C:\Program Files\QGIS 2.18\bin>if not "" == "" goto langset 
C:\Program Files\QGIS 2.18\bin>FOR /F "usebackq delims==" %i IN (`"C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\winlocale"`) DO @set LANG=%i 
C:\Program Files\QGIS 2.18\bin>set PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY 
C:\Program Files\QGIS 2.18\bin>set PYTHONPATH=;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\python;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.0\etc\wxpython\n 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="MAPSET=PERMANENT" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="LOCATION=temp_location" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="LOCATION_NAME=temp_location" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="GISDBASE=C:\Users\GREGOR~1\AppData\Local\Temp\processing0a9b71eb1386424a82b45af78aa98c7b\grassdata" 
C:\Program Files\QGIS 2.18\bin>g.gisenv.exe set="GRASS_GUI=text" 
C:\Program Files\QGIS 2.18\bin>v.out.ogr -s -e input=tmp1499246114155 output="C:\Users\GREGOR~1\AppData\Local\Temp\processing0a9b71eb1386424a82b45af78aa98c7b\08601010edb84d7093d5526d0fb0a7af" format=ESRI_Shapefile output_layer=output 
FEHLER: Vektorkarte nicht gefunden. 
C:\Program Files\QGIS 2.18\bin>exit 
Converting outputs
Lade Ergebnis Layer
The following layers were not correctly generated.
Rast stats
You can check the log messages to find more information about the execution of the algorithm*
  • It stumbles over "layer=gravel bar are 04" which contains white spaces which are not quoted. Workaround: avoid white space and try underscore or single word layers. – markusN Aug 30 '18 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.