[GRASS-user] Converting raster to polygon creates too many polygons

Hanlie Pretorius hanlie.pretorius at gmail.com
Wed Sep 29 08:11:03 EDT 2010


Hi,

I've created subcatchments using r.watershed and I would like to
convert these to polygons. My result at the moment contains too many
polygons - 194. The original raster had only 9 areas, which should all
have been contiguous seeing that they came from r.watershed.

Here is the sequence of commands that I use, starting with r.report
for the information about the subcatchments raster:
-----
 |   Type of Map:  raster               Number of Categories: 18
 |   Data Type:    CELL
 |   Rows:         33443
 |   Columns:      33008
 |   Total Cells:  1103886544
 |        Projection: Transverse Mercator
 |            N: -3122229.69982072    S: -3155672.30728643   Res: 0.99998826
 |            E: -33474.90929218    W: -66483.27873573   Res: 1.00001119
 |   Range of data:    min = 2  max = 18
-----

# Set the resolution to 25m
g.region rast=c83a_border res=25

# Convert the subcatchment raster to vector
r.to.vect --overwrite
input=c83a_dem_25m_clipped_basins_100000_clipped at PERMANENT
output=c83a_subcatchments at PERMANENT feature=area

v.report for the resulting vector gives me 194 categories. The
original raster had only 9 areas, which should all have been
contiguous seeing that they come from r.watershed.

What am I doing wrong? I want an output vector with 9 polygons
corresponding to the original 9 areas in the subcatchment raster.

Thanks
Hanlie


More information about the grass-user mailing list