[GRASS-user] [beginner][r.to.vect] -v? polygonizing only white parts of an image

Hello,

I'm a beginner in GRASS but hope to master it someday
it looks infinite in terms of possibilities

I'm trying to polygonize a raster.
this raster is in black and white.

I want to polygonize only the white parts of the image.

I noticed that r.to.vect had a -v option allowing to polygonize certain
parts of an image. Is it this option that I must use to vectorize the white
parts of my image? If yes, how can I use it? If not, how to manage the
operation?

Any help would be greatly appreciated!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/beginner-r-to-vect-v-polygonizing-only-white-parts-of-an-image-tp5103294p5103294.html
Sent from the Grass - Users mailing list archive at Nabble.com.

baobazz wrote:

I'm trying to polygonize a raster.
this raster is in black and white.

I want to polygonize only the white parts of the image.

I noticed that r.to.vect had a -v option allowing to polygonize certain
parts of an image. Is it this option that I must use to vectorize the white
parts of my image? If yes, how can I use it? If not, how to manage the
operation?

use -v, but before that use r.mask, r.reclass, or r.mapcalc to make a MASK
map so only the white bits are visible to the r.to.vect module. After you
are done remember to remove or rename the MASK map :slight_smile:

Hamish

Hello and thanks, Hamish, for the answer

After thinning my image with r.thin, I described my thinned raster
r.describe rasterThin

* 1

The white parts of my image seemed to be *
I launched r.reclass input=rasterThin output=rasterReclass

1=NULL
*=1 black

But I got everything equal to NULL=>blank image..

So, I recalculated my map so as to replace NULL values by 0 value.
r.mapcalc if(isnull(rasterThin), 0, rasterThin)

Then, i processed it with r.to.vect
Then, I cleant the result with the snap and prune tools
--
Just one question:
r.describe rasterThin gave me

* 1

Did "*" mean "everything else than 1" or everything?
Why did I get a blank/NULL map?

Thanks a lot!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/beginner-r-to-vect-v-polygonizing-only-white-parts-of-an-image-tp5103294p5107720.html
Sent from the Grass - Users mailing list archive at Nabble.com.

baobazz wrote:

Just one question:
r.describe rasterThin gave me
>* 1
Did "*" mean "everything else than 1" or everything?
Why did I get a blank/NULL map?

"*" means NULL values. see the help page-
  http://grass.osgeo.org/grass64/manuals/html64_user/r.describe.html

Hamish

thanks for the answer

I launched

r.reclass input=rasterThin output=rasterReclass

1=NULL
*=1 black

so as to fill null values

I don't understand why my resulting map was a NULL=>blank raster..
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/beginner-r-to-vect-v-polygonizing-only-white-parts-of-an-image-tp5103294p5108406.html
Sent from the Grass - Users mailing list archive at Nabble.com.