[GRASS-dev] finding the hole of a donut

I have a vector shape with some complexly shaped empty areas inside. I'd like to somehow extract these empty areas--eventually as a raster. I want to use these interior empty space to make that part of a raster null.

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?

Michael

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

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

Michael Barton wrote:

I have a vector shape with some complexly shaped empty areas inside.
I'd like to somehow extract these empty areas--eventually as a
raster. I want to use these interior empty space to make that part of
a raster null.

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?

v.centroids + v.dissolve to remove holes, then run v.overlayfor holes
filled version versus original op=not?

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ