1r.to.vect(1) GRASS GIS User's Manual r.to.vect(1)
2
3
4
6 r.to.vect - Converts a raster map into a vector map.
7
9 raster, conversion, geometry, vectorization
10
12 r.to.vect
13 r.to.vect --help
14 r.to.vect [-svzbt] input=name output=name type=string [column=name]
15 [--overwrite] [--help] [--verbose] [--quiet] [--ui]
16
17 Flags:
18 -s
19 Smooth corners of area features
20
21 -v
22 Use raster values as categories instead of unique sequence (CELL
23 only)
24
25 -z
26 Write raster values as z coordinate
27 Table is not created. Currently supported only for points.
28
29 -b
30 Do not build vector topology
31 Recommended for massive point conversion
32
33 -t
34 Do not create attribute table
35
36 --overwrite
37 Allow output files to overwrite existing files
38
39 --help
40 Print usage summary
41
42 --verbose
43 Verbose module output
44
45 --quiet
46 Quiet module output
47
48 --ui
49 Force launching GUI dialog
50
51 Parameters:
52 input=name [required]
53 Name of input raster map
54
55 output=name [required]
56 Name for output vector map
57
58 type=string [required]
59 Output feature type
60 Options: point, line, area
61
62 column=name
63 Name of attribute column to store value
64 Name must be SQL compliant
65 Default: value
66
68 r.to.vect scans the named input raster map layer, extracts points,
69 lines or area edge features from it, converts data to GRASS vector for‐
70 mat.
71
72 Point conversion
73 The r.to.vect program extracts data from a GRASS raster map layer and
74 stores output in a new GRASS vector file.
75
76 Line conversion
77 r.to.vect assumes that the input map has been thinned using r.thin.
78
79 r.to.vect extracts vectors (aka, "arcs") from a raster map. These arcs
80 may represent linear features (like roads or streams), or may represent
81 area edge features (like political boundaries, or soil mapping units).
82
83 r.thin and r.to.vect may create excessive nodes at every junction, and
84 may create small spurs or "dangling lines" during the thinning and vec‐
85 torization process. These excessive nodes and spurs may be removed
86 using v.clean.
87
88 Area conversion
89 r.to.vect first traces the perimeter of each unique area in the raster
90 map layer and creates vector data to represent it. The cell category
91 values for the raster map layer will be used to create attribute infor‐
92 mation for the resultant vector area edge data.
93
94 A true vector tracing of the area edges might appear blocky, since the
95 vectors outline the edges of raster data that are stored in rectangular
96 cells. To produce a better-looking vector map, r.to.vect smoothes the
97 corners of the vector data as they are being extracted. At each change
98 in direction (i.e., each corner), the two midpoints of the corner cell
99 (half the cell’s height and width) are taken, and the line segment con‐
100 necting them is used to outline this corner in the resultant vector
101 map. (The cell’s cornermost node is ignored.) Because vectors are
102 smoothed by this program, the resulting vector map will not be "true"
103 to the raster map from which it was created. The user should check the
104 resolution of the geographic region (and the original data) to estimate
105 the possible error introduced by smoothing.
106
107 r.to.vect extracts only area edges from the named raster input file. If
108 the raster map contains other data (i.e., line edges, or point data)
109 the output may be wrong.
110
112 The examples are based on the North Carolina sample dataset:
113
114 Conversion of raster points to vector points:
115
116 Random sampling of points:
117 g.region raster=elevation -p
118 # random sampling of points (note that r.random also writes vector points)
119 r.random elevation raster_output=elevrand1000 n=1000
120 r.to.vect input=elevrand1000 output=elevrand1000 type=point
121 # univariate statistics of sample points
122 v.univar elevrand1000 column=value type=point
123 # compare to univariate statistics on original full raster map
124 r.univar elevation
125
126 Conversion of raster lines to vector lines:
127
128 Vectorization of streams in watershed basins map:
129 g.region raster=elevation -p
130 r.watershed elev=elevation stream=elev.streams thresh=50000
131 r.to.vect -s input=elev.streams output=elev_streams type=line
132 # drop "label" column which is superfluous in this example
133 v.db.dropcolumn map=elev_streams column=label
134 v.db.renamecolumn map=elev_streams column=value,basin_id
135 # report length per basin ID
136 v.report map=elev_streams option=length units=meters sort=asc
137
138 Conversion of raster polygons to vector polygons:
139
140 Vectorization of simplified landuse class map:
141 g.region raster=landclass96 -p
142 # we smooth corners of area features
143 r.to.vect -s input=landclass96 output=my_landclass96 type=area
144 v.colors my_landclass96 color=random
145
147 For type=line the input raster map MUST be thinned by r.thin; if not,
148 r.to.vect may crash.
149
151 g.region, r.thin, v.clean
152
154 Point support
155 Bill Brown
156 Line support
157 Mike Baba
158 DBA Systems, Inc.
159 10560 Arrowhead Drive
160 Fairfax, Virginia 22030
161 Area support
162 Original version of r.poly:
163 Jean Ezell and Andrew Heekin,
164 U.S. Army Construction Engineering Research Laboratory
165
166 Modified program for smoothed lines:
167 David Satnik, Central Washington University
168 Updated 2001 by Andrea Aime, Modena, Italy
169 Update
170 Original r.to.sites, r.line and r.poly merged and updated to 5.7 by
171 Radim Blazek
172
174 Available at: r.to.vect source code (history)
175
176 Main index | Raster index | Topics index | Keywords index | Graphical
177 index | Full index
178
179 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
180
181
182
183GRASS 7.8.5 r.to.vect(1)