I'm using GRASS 6.4.3 in Linuxmint 16.
I have a bash script for GRASS which I use to process almost 300 raster files.
The script first imports some raster files (
r.in.gdal), then does some calculations and classification (using
r.reclass). And finally transforms the resultant raster to vector (
r.to.vect) and saves it (
Let's say each vector files has a field labeled category and that it takes only two values 1 and 2. As I'm interested only in the total area of polygons with category = 2 and with an area higher than 10,000 m2, I open each vector file in QGIS, edit its attribute table, calculate the area of each polygon and eliminate all of them with category=1 and $area<10,000.
But I have to do it manually,
Is there a way to do it in a batch process within QGIS?
Or even better, is it possible to do it in GRASS?
Is it possible to edit the attribute table within the command console in GRASS?
Could I do it in the same bash script which I use to do all the other processes in GRASS?
I've been reading this but I'm not sure how to apply it to my problem. I couldn't find how to calculate the polygons area and add it to a new column using GRASS.
I think I could use
db.select to search for the polygons I want to eliminate, but I don't know how to do it.
Thanks for your help!