1v.decimate(1) Grass User's Manual v.decimate(1)
2
3
4
6 v.decimate - Decimates a point cloud
7 Copies points from one vector to another while applying different deci‐
8 mations
9
11 vector, LIDAR, generalization, decimation, extract, select, points,
12 level1
13
15 v.decimate
16 v.decimate --help
17 v.decimate [-gfczxbt] input=name [layer=string] output=name
18 [zrange=min,max] [cats=range] [skip=integer] [preserve=integer]
19 [offset=integer] [limit=integer] [zdiff=float] [cell_limit=inte‐
20 ger] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
21
22 Flags:
23 -g
24 Apply grid-based decimation
25
26 -f
27 Use only first point in grid cell during grid-based decimation
28
29 -c
30 Only one point per cat in grid cell
31
32 -z
33 Use z in grid decimation
34
35 -x
36 Store only the coordinates, throw away categories
37 Do not story any categories even if they are present in input data
38
39 -b
40 Do not build topology
41 Advantageous when handling a large number of points
42
43 -t
44 Do not create attribute table
45
46 --overwrite
47 Allow output files to overwrite existing files
48
49 --help
50 Print usage summary
51
52 --verbose
53 Verbose module output
54
55 --quiet
56 Quiet module output
57
58 --ui
59 Force launching GUI dialog
60
61 Parameters:
62 input=name [required]
63 Name of input vector map
64 Or data source for direct OGR access
65
66 layer=string
67 Layer number or name (’-1’ for all layers)
68 A single vector map can be connected to multiple database tables.
69 This number determines which table to use. When used with direct
70 OGR access this is the layer name.
71 Default: -1
72
73 output=name [required]
74 Name for output vector map
75
76 zrange=min,max
77 Filter range for z data (min,max)
78
79 cats=range
80 Category values
81 Example: 1,3,7-9,13
82
83 skip=integer
84 Throw away every n-th point
85 For example, 5 will import 80 percent of points. If not specified,
86 all points are copied
87
88 preserve=integer
89 Preserve only every n-th point
90 For example, 4 will import 25 percent of points. If not specified,
91 all points are copied
92
93 offset=integer
94 Skip first n points
95 Skips the given number of points at the beginning.
96
97 limit=integer
98 Copy only n points
99 Copies only the given number of points
100
101 zdiff=float
102 Minimal difference of z values
103 Minimal difference between z values in grid-based decimation
104
105 cell_limit=integer
106 Preserve only n points per grid cell
107 Preserves only the given number of points per grid cell in
108 grid-based decimation
109
111 v.decimate reduces number of points in the input vector map and copies
112 them over to the output vector map. Different point decimation tech‐
113 niques can be applied to reduce the number of points.
114
115 Two main decimation techniques are:
116
117 · count-based decimation (skip, preserve, offset and limit
118 options)
119
120 · grid-based decimation (-g flag)
121
122 The grid-based decimation will remove points based on:
123
124 · similar z coordinates (-z flag and zdiff option)
125
126 · same categories (-c flag)
127
128 · count of points (-f flag and cell_limit option)
129
130 The grid-based decimation is currently using a 2D grid, so the points
131 are placed and compared within this 2D grid. The comparison can happen
132 using z coordinates or categories. Note that although the grid is only
133 2D, the module works with 3D points.
134
135 The grid-based decimation extent and resolution depend on the current
136 computational region as set by g.region. As a consequence, the output
137 is limited only to computational region in this case.
138
139 TODO: Currently, any output is limited by the region.
140
141 The count-based decimation result highly depends on how the data are
142 ordered in the input. This applies especially to offset and limit
143 options where the resulting shape and densities can be surprising. The
144 options skip and preserve are influenced by order of points in a simi‐
145 lar way but they usually keep relative density of points (which may or
146 may not be desired). On the other hand, the grid-based decimation will
147 generally result in more even density of output points (see Figure 1).
148
149 Besides decimation, point count can be reduced by applying different
150 selections or filters, these are:
151
152 · selection by category (cats option)
153
154 · selection by z values (zrange option)
155
157 The grid-based decimation requires all points which will be saved in
158 output to fit into the computer’s memory (RAM). It is advantageous to
159 have the region only in the area with the points, otherwise unnecessary
160 memory is allocated. Higher (finer) resolutions and higher amount of
161 preserved points per cell require more memory. The count-based decima‐
162 tion has no limitation regarding the available memory.
163
164 Significant speed up can be gained using -b flag which disables build‐
165 ing of topology for the output vector map. This may limit the use of
166 the vector map by some modules, but for example, this module works
167 without topology as well.
168
170 Keep only every forth point, throw away the rest:
171 v.decimate input=points_all output=points_decimated_every_4 preserve=4
172
173 Keep only points within a grid cell (given by the current computational
174 region) which has unique categories (e.g. LIDAR classes):
175 v.decimate input=points_all output=points_decimated_unique_cats layer=1 -g -c
176
177 Figure 1: Comparison of original points, decimation result with every
178 forth point preserved, and grid-based decimation result with points
179 with unique categories in each grid cell
180
181 Keep only points with category 2 and keep only approximately 80% of the
182 points:
183 v.decimate input=points_all output=points_decimated_ skip=5 cats=2 layer=1
184
186 v.extract, v.outlier, v.select, v.category, v.build, v.in.lidar,
187 g.region
188
190 Vaclav Petras, NCSU OSGeoREL
191
192 Last changed: $Date: 2015-10-01 03:55:00 +0200 (Thu, 01 Oct 2015) $
193
195 Available at: v.decimate source code (history)
196
197 Main index | Vector index | Topics index | Keywords index | Graphical
198 index | Full index
199
200 © 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual
201
202
203
204GRASS 7.6.0 v.decimate(1)