1v.clean(1) Grass User's Manual v.clean(1)
2
3
4
6 v.clean - Toolset to clean vector topology
7
9 vector
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]
17
18 Flags:
19 -b Do not rebuild and store the topology at the end
20
21 --overwrite
22
23 Parameters:
24 input=name
25 Name of input vector map
26
27 output=name
28 Name for output vector map
29
30 type=string[,string,...]
31 Type Options: point,line,boundary,centroid,area Default:
32 point,line,boundary,centroid,area
33
34 error=name
35 Name of output map where errors are written
36
37 tool=string[,string,...]
38 Cleaning tool Options: break,rmdupl,rmdangle,chdan‐
39 gle,rmbridge,chbridge,snap,rmdac,bpol,prune,rmarea,rmsa break:
40 break lines at each intersection rmdupl: remove duplicate lines
41 (pay attention to categories!) rmdangle: remove dangles, threshold
42 ignored if < 0 chdangle: change the type of boundary dangle to
43 line, threshold ignored if < 0, input line type is ignored
44 rmbridge: remove bridges connecting area and island or 2 islands
45 chbridge: change the type of bridges connecting area and island or
46 2 islands from boundary to line snap: snap lines to vertex in
47 threshold rmdac: remove duplicate area centroids ('type' option
48 ignored) bpol: break (topologically clean) polygons (imported from
49 non topological format (like shapefile). Boundaries are broken on
50 each point shared between 2 and more polygons where angles of seg‐
51 ments are different prune: remove vertices in threshold from lines
52 and boundaries, boundary is pruned only if topology is not damaged
53 (new intersection, changed attachement of centroid), first and last
54 segment of the boundary is never changed rmarea: remove small
55 areas, the longest boundary with adjacent area is removed rmsa:
56 remove small angles between lines at nodes
57
58 thresh=float[,float,...]
59 Threshold Threshold in map units, one value for each tool (default:
60 0.0[,0.0,...])
61
63 v.clean allows the user to automatically fix topology of vector files.
64
66 The user does not have to run v.build on the output vector, unless the
67 -b flag was used. The -b flag affects only the output vector - topology
68 is always built for error vector.
69
70 Removing small angles between lines at nodes
71 The rmsa tool only concerns angles which are so small that the calcu‐
72 lated angle is 0. The user cannot change this threshold. The following
73 figure should help to understand what the tool does.
74
75 What is a bridge?
76 A bridge is an area type connection of an island (polygon in a polygon)
77 to the outer polygon. This is topologically incorrect (but OGC Simple
78 Features allow it). v.clean can be used to optionally change the line
79 type to fulfill the topology rules or to remove the bridge from the
80 map:
81 +-------------+ +-------------+ +-------------+
82 | P| P: polygon | P| | P|
83 | +---+ | I: island | +---+ | | +---+ |
84 | | I | | B: bridge | | I | | | | I | |
85 | | | | L: line | | | | | | | |
86 | +-+-+ | | +---+ | | +-.-+ |
87 | | | | | | . |
88 | | B | | | | . L |
89 | | | | | | . |
90 +------+------+ +-------------+ +-------------+
91
92
94 Snap lines to vertex in threshold
95
96 v.clean input=testmap output=cleanmap tool=snap thresh=1
97
98
99 Cleaning OGR imported data (Simple Feature data)
100 The import of areas with v.in.ogr requires a subsequent run of v.clean
101 to update the map to a topologically valid structure (removal of dupli‐
102 cate collinear lines etc). The tools used for that are 'rmdupl' and
103 'bpol':
104 v.clean input=areamap output=areamap_clean tool=rmdupl,bpol
105
106
107 Extracting intersection points of vector lines
108
109 v.clean input=lines1 output=lines2 err=points tool=break
110 Intersection points are written to 'points' map.
111
112 Break lines
113 v.clean will break the lines where they cross, creating new node if
114 needed. Example:
115 v.in.ascii -n out=crossed_lines format=standard << EOF
116 L 2
117 0 5
118 10 5
119 L 2
120 5 0
121 5 10
122 EOF
123 v.clean in=crossed_lines out=crossed_lines_brk \
124 error=intersection tool=break
125
126
128 David Gerdes, U.S. Army Construction Engineering Research Laboratory
129 Radim Blazek, ITC-Irst, Trento, Italy
130
131 Last changed: $Date: 2006/09/29 21:22:55 $
132
133 Full index
134
135
136
137GRASS 6.2.2 v.clean(1)