Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using the GRASS plugin in QGIS. I am trying to calculate the average value of a raster dataset within a set of polygons.

I have created a new mapset and have imported both the vector and raster layers into the GRASS mapset.

I am now trying to calculate the set of statistics using the v.rast.stats tool.

It starts to run and then comes up with the error an error occurred while converting vector to raster and then 'raster map not found'.

v.rast.stats raster=secant_grass@zonalstats
vector=plots_grass@zonalstats
colprefix=g/Applications/GRASS-6.4.app/Contents/MacOS/scripts/v.rast.stats:
line 190: 632 Segmentation fault v.to.rast in="$VECTORFULL"
out="${VECTOR}_$TMPNAME" layer="$GIS_OPT_LAYER" use=cat type=area
--quiet An error occurred while converting vector to raster Raster map not found  nothing removed Finished with error

Any help would be greatly appreciated.

Regards

share|improve this question
1  
Can you provide the output of g.list rast and the full syntax of your v.rast.stats? –  maning Apr 11 '12 at 1:42
    
when I type 'g.list' into the 'Modules list' no module appears. –  Becky Apr 11 '12 at 12:16
    
Please post which GRASS version you use. –  markusN May 18 '12 at 23:05
add comment

2 Answers

Use the zonal statistics plugin in QGIS - this gives you the count, sum and mean of a raster within a given polygon.

share|improve this answer
add comment

Or use the version 1.4 of the LecoS plugin for QGIS, if zonal statistics and GRASS fail you. You can find the plugin via the downloader, but you must have the scientific library "Scipy" installed.

See an example use-case on my blog,which deals with exactly your problem. Hope it helps :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.