[GRASS-user] v.rast.stats No categories found in raster map

sonja1 sonja.jankowfsky at cemagref.fr
Fri Nov 26 08:22:55 EST 2010


Hi,
I'm trying to run the v.rast.stats script using a vector map and a dem as
input. 
The strange thing is, that for one vector map the script works fine, and for
another vector map I get the error "No categories found in raster map". As
far as I understood, this error is related to the vector map, not the raster
map due to the following lines in the v.rast.stats script. So, I thought
this might be related to a bad topology of the vector map. But even a test
case with only 1 polygon gives me the "No categories found" error. I checked
the vector maps, but in every map I have categories and centroids.
Does anybody know how to resolve this problem?
Thanks a lot,
Sonja

#prepare raster MASK
v.to.rast in="$VECTOR" out="${VECTOR}_${TMPNAME}" use=cat --quiet
if [ $? -ne 0 ] ; then
   g.message -e "An error occurred while converting vector to raster"
   cleanup
   exit 1
fi


#dump cats to file to avoid "too many argument" problem:
r.category "${VECTOR}_${TMPNAME}" fs=';' --quiet | cut -d';' -f1 >
"$TEMPFILE.cats"
#echo "List of categories found: $CATSLIST"
NUMBER=`cat "$TEMPFILE.cats" | wc -l | awk '{print $1}'`
if [ $NUMBER -lt 1 ] ; then
   g.message -e "No categories found in raster map"
   cleanup
   exit 1
fi



-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/v-rast-stats-No-categories-found-in-raster-map-tp5777233p5777233.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list