1v.clean(1) Grass User's Manual v.clean(1)
2
3
4
6 v.clean - Toolset for cleaning topology of vector map.
7
9 vector, topology
10
12 v.clean
13 v.clean help
14 v.clean [-b] input=name output=name [type=string[,string,...]]
15 [error=name] tool=string[,string,...] [thresh=float[,float,...]]
16 [--overwrite] [--verbose] [--quiet]
17
18 Flags:
19 -b
20 Don't build topology for the output vector
21
22 --overwrite
23 Allow output files to overwrite existing files
24
25 --verbose
26 Verbose module output
27
28 --quiet
29 Quiet module output
30
31 Parameters:
32 input=name
33 Name of input vector map
34
35 output=name
36 Name for output vector map
37
38 type=string[,string,...]
39 Type
40 Feature type(s)
41 Options: point,line,boundary,centroid,area
42 Default: point,line,boundary,centroid,area
43
44 error=name
45 Name of output map where errors are written
46
47 tool=string[,string,...]
48 Cleaning tool
49 Options: break,snap,rmdangle,chdan‐
50 gle,rmbridge,chbridge,rmdupl,rmdac,bpol,prune,rmarea,rmline,rmsa
51 break: break lines at each intersection
52 snap: snap lines to vertex in threshold
53 rmdangle: remove dangles, threshold ignored if < 0
54 chdangle: change the type of boundary dangle to line, threshold
55 ignored if < 0, input line type is ignored
56 rmbridge: remove bridges connecting area and island or 2 islands
57 chbridge: change the type of bridges connecting area and island or
58 2 islands from boundary to line
59 rmdupl: remove duplicate lines (pay attention to categories!)
60 rmdac: remove duplicate area centroids ('type' option ignored)
61 bpol: break (topologically clean) polygons (imported from non topo‐
62 logical format, like ShapeFile). Boundaries are broken on each
63 point shared between 2 and more polygons where angles of segments
64 are different
65 prune: remove vertices in threshold from lines and boundaries,
66 boundary is pruned only if topology is not damaged (new intersec‐
67 tion, changed attachement of centroid), first and last segment of
68 the boundary is never changed
69 rmarea: remove small areas, the longest boundary with adjacent area
70 is removed
71 rmline: remove all lines or boundaries of zero length, threshold is
72 ignored
73 rmsa: remove small angles between lines at nodes
74
75 thresh=float[,float,...]
76 Threshold
77 Threshold in map units, one value for each tool (default:
78 0.0[,0.0,...])
79
81 v.clean allows the user to automatically fix topology of vector maps.
82
84 The user does not have to run v.build on the output vector, unless the
85 -b flag was used. The -b flag affects only the output vector - topology
86 is always built for error vector.
87
88 Removing small angles between lines at nodes
89 The rmsa tool only concerns angles which are so small that the calcu‐
90 lated angle is 0. The user cannot change this threshold. The following
91 figure should help demonstrate what the tool does.
92
93 |
94 | tool=rmsa
95
96 What is a bridge?
97 A bridge is an area type connection of an island (polygon in a polygon)
98 to the outer polygon. This is topologically incorrect (but OGC Simple
99 Features allow it). v.clean can be used to optionally change the line
100 type to fulfill the topology rules or to remove the bridge from the
101 map:
102 +-------------+ +-------------+ +-------------+
103 | P| P: polygon | P| | P|
104 | +---+ | I: island | +---+ | | +---+ |
105 | | I | | B: bridge | | I | | | | I | |
106 | | | | L: line | | | | | | | |
107 | +-+-+ | | +---+ | | +-.-+ |
108 | | | | | | . |
109 | | B | | | | . L |
110 | | | | | | . |
111 +------+------+ +-------------+ +-------------+
112
113
115 Snap lines to vertex in threshold
116
117 v.clean input=testmap output=cleanmap tool=snap thresh=1
118
119
120 Cleaning OGR imported data (Simple Feature data)
121 The import of areas with v.in.ogr requires a subsequent run of v.clean
122 to update the map to a topologically valid structure (removal of dupli‐
123 cate collinear lines etc). The tools used for that are 'rmdupl' and
124 'bpol':
125 v.clean input=areamap output=areamap_clean tool=rmdupl,bpol
126
127
128 Extracting intersection points of vector lines
129
130 v.clean input=lines1 output=lines2 err=points tool=break
131 Intersection points are written to 'points' map.
132
133 Break lines
134 v.clean will break the lines where they cross, creating new node if
135 needed. Example:
136 v.in.ascii -n out=crossed_lines format=standard << EOF
137 L 2
138 0 5
139 10 5
140 L 2
141 5 0
142 5 10
143 EOF
144 v.clean in=crossed_lines out=crossed_lines_brk \
145 error=intersection tool=break
146
147
148 Remove all lines of zero length
149
150 v.out.ascii zero format=standard
151 L 2 1
152 -819832.09065589 -987825.2187231
153 -806227.28362601 -971104.80702988
154 1 1
155 L 2 1
156 -799165.24638913 -972974.16982788
157 -799165.24638913 -972974.16982788
158 1 2
159 v.clean input=zero output=zero_clean tool=rmline type=line
160 v.out.ascii zero_clean format=standard
161 L 2 1
162 -819832.09065589 -987825.2187231
163 -806227.28362601 -971104.80702988
164 1 1
165
166
168 David Gerdes, U.S. Army Construction Engineering Research Laboratory
169 Radim Blazek, ITC-irst, Trento, Italy
170 Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy
171
172 Last changed: $Date: 2007-07-13 17:17:33 +0200 (Fri, 13 Jul 2007) $
173
174 Full index
175
176 © 2003-2008 GRASS Development Team
177
178
179
180GRASS 6.3.0 v.clean(1)