<div dir="ltr"><div>Hi all,<br><br>I have added v.decimate to trunk in r66387 [1]. The current version can do count-based decimation in the same way as the current v.in.lidar module [2]. Additionally, a grid-based decimation is supported. The grid is 2D and the points are preserved based on z, category or count (within one cell).<br><br>The grid-based decimation requires to store whole output (but not input) in the memory, so it is not practical for large datasets. This will hopefully change in the future. One way would be to employ same mechanism as in r.in.lidar where we use small grid but we iterate multiple times over the input dataset. Another ways are allocation of the cells on demand (instead of whole grid based on region, perhaps necessary for 3D), keeping less information per point (e.g. only z sum and count), or store something to disk.<br><br></div>The module, especially at this stage, should be perhaps in addons rather than trunk. However, the module already has some code overlap with v.in.lidar and there is potential code overlap with other modules as well, e.g. r.in.lidar. So, the idea is that some code will be moved to lib/lidar and used by these modules. This v.decimate module is than a comfortable way how to test the library functions.<br><div><div><br></div><div>The module currently lacks tests and code documentation, but I've already prepared some user documentation [3].<br></div><div><br></div><div>Please comment and feel free to criticize the code quality etc. since I'm planning to put it into the library eventually.<br></div><div><br></div><div>Vaclav<br></div><div><br>[1] <a href="https://trac.osgeo.org/grass/changeset/66387">https://trac.osgeo.org/grass/changeset/66387</a><br>[2] <a href="https://lists.osgeo.org/pipermail/grass-dev/2015-September/076275.html">https://lists.osgeo.org/pipermail/grass-dev/2015-September/076275.html</a><br>[3] <a href="https://grass.osgeo.org/grass71/manuals/v.decimate.html">https://grass.osgeo.org/grass71/manuals/v.decimate.html</a><br><br><br></div><div>PDAL-related: The PDAL's counterpart to v.decimate is a the GridMinimum PCL Block 
filter [4, 5, 6] which according to the documentation preserves point 
with the minimum z value in each cell (as if r.in.lidar would have 
vector output, but preserved xy position). The other, perhaps more 
similar, filter in PDAL is voxelgrid [7] (based on PCL's VoxelGrid [8, 9]) which 
can do a 3D grid or 2D grid (if z resolution is large enough value). The
 result is centroid of points within each grid cell/voxel (while 
v.decimate now preserves xyz and layers/cats of the input).</div><div><br>[4] <a href="http://www.pdal.io/stages/filters.pclblock.html">http://www.pdal.io/stages/filters.pclblock.html</a><br>[5] <a href="http://www.pdal.io/tutorial/pcl_spec.html#gridminimum">http://www.pdal.io/tutorial/pcl_spec.html#gridminimum</a><br>[6] <a href="http://docs.pointclouds.org/trunk/classpcl_1_1_grid_minimum.html">http://docs.pointclouds.org/trunk/classpcl_1_1_grid_minimum.html</a><br>[7] <a href="http://www.pdal.io/stages/filters.voxelgrid.html">http://www.pdal.io/stages/filters.voxelgrid.html</a><br>[8] <a href="http://www.pdal.io/tutorial/pcl_spec.html#voxelgrid">http://www.pdal.io/tutorial/pcl_spec.html#voxelgrid</a><br>[9] <a href="http://docs.pointclouds.org/trunk/classpcl_1_1_voxel_grid_3_01pcl_1_1_p_c_l_point_cloud2_01_4.html">http://docs.pointclouds.org/trunk/classpcl_1_1_voxel_grid_3_01pcl_1_1_p_c_l_point_cloud2_01_4.html</a><br><br></div></div></div>