[GRASS-dev] finding the hole of a donut

Michael Barton michael.barton at asu.edu
Sat Feb 23 21:19:47 EST 2008


Thanks. We'll try this.

Michael



On Feb 23, 2008, at 8:22 AM, Maciej Sieczka wrote:

> Michael Barton pisze:
>
>> It's kind of like wanting to extract the hole of a donut but NOT  
>> get the area outside the donut too.
>> Any suggestions as to how to go about this?
>
> #find the min & max category of your donuts
> cat_min=`v.category donuts opt=print | head -n1`
> cat_max=`v.category donuts opt=print | tail -n1`
>
> # calculate 1st free cat
> cat_1stfree=`expr $cat_max + 1`
>
> # fills holes with jam
> v.centroids in=donuts out=donuts_with_jam opt=add cat=$cat_1stfree  
> st=1
>
> # extract jam
> v.extract -r in=donuts_with_jam out=jam type=area list=$cat_min- 
> $cat_max
>
> Maciek



More information about the grass-dev mailing list