On 20/07/11 2:00 AM, [email protected] wrote:
Message: 3
Date: Mon, 18 Jul 2011 12:14:19 -0700 (PDT)
From: mmann1123<[email protected]>
Subject: [GRASS-user] Loops& v.extract for fire data
To:[email protected]
Message-ID:<[email protected]>
Content-Type: text/plain; charset=us-ascii
Ok I have a fairly complex vector of fire burn areas. Show below:
http://osgeo-org.1803224.n2.nabble.com/file/n6595999/data.jpg
I want to be able to do a v.extract and create a new file for each year
(data spans 1910-2010). I know how to run v.extract with a simple SQL query
on the command line but I can not figure out how to iterate in a loop. Any
ideas? Can this all be done within the grass command console? Thanks!!!!
Mike M
Without any information about your maps! ... here's an example for the
command line (ie, bash):
for i in [variable list of some kind]; do
v.extract [parameters];
done
If (for example) "year" is stored as a database field, you could do this:
for i in `v.db.select [input map] column=year -c`; do
v.extract [input map] output="name_"$i where='cat=$i';
done
Cheers
Richard
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user