[GRASSLIST:9443] r.to.vect give strange results

Hi All,

I'm trying to convert a raster into a vector with several areas, and I am getting very strange results. r.to.vect gives me a vector that is a box drawn around every pixel in the raster, with a centroid for each box. So I ran r.mapcalc to convert the raster into a binary raster, and then ran r.to.vect again. This time, the r.to.vect says the file has not been properly thinned. so I ran r.thin first and then r.to.vect again - still says that the file has not been properly thinned. What am I missing? This should be easy.

- Jason

please post exact commands you use, exact Grass messages - copy/paste

I mean - post to the Grasslist, not to me :slight_smile:

Maciek

Ok here we go.

1) first attempt:
GRASS 6.1.cvs (tx_state_nad83):~ > r.to.vect in=test out=test_vect
crowded cell 6H (1,238) -continuing
crowded cell 6H (1,239) -continuing
crowded cell 6H (1,240) -continuing
update_list: crowded cell 7H (1,244)
ERROR: cell file is not thinned properly.
        Please run r.thin

2) thinning:
GRASS 6.1.cvs (tx_state_nad83):~ > r.thin in=test out=test_thin
File test -- 336 rows X 448 columns
Bounding box: l = 2, r = 449, t = 2, b = 337
    Path number 1
         Deleted 10063 pixels
.
    Path number 30
         Deleted 31 pixels
thinning completed successfully.
Output file 336 rows X 448 columns
Window 336 rows X 448 columns

3) second attempt after thinning:
GRASS 6.1.cvs (tx_state_nad83):~ > r.to.vect in=test_thin out=test_vect
update_list: isolated cell (46,215)
.
update_list: isolated cell (184,194)
crowded cell 6H (184,266) -continuing
update_list: crowded cell 7H (200,240)
ERROR: cell file is not thinned properly.
        Please run r.thin
GRASS 6.1.cvs (tx_state_nad83):~ >

Even though I get the error, a vector file (test_vect) is still created. However, if I attempt to display that vector, I get the following errors:

GRASS 6.1.cvs (tx_state_nad83):~ > d.vect test_vect
WARNING: coor files of vector 'test_vect@PERMANENT' is larger than it
          should be (151584 bytes excess).
WARNING: Cannot display areas, topology not available

I'm trying to convert a raster into a vector with several areas, and
I am getting very strange results. r.to.vect gives me a vector that
is a box drawn around every pixel in the raster, with a centroid for
each box. So I ran r.mapcalc to convert the raster into a binary
raster, and then ran r.to.vect again. This time, the r.to.vect says
the file has not been properly thinned. so I ran r.thin first and
then r.to.vect again - still says that the file has not been properly
thinned. What am I missing? This should be easy.

threshold with r.reclass or r.maplcac? or simply convert a floating
point map to an integer map (DCELL to CELL) with r.mapcalc's int(mapname)?

-v flag?

see also r.contour

Hamish