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