diff --git a/doc/apps/ground.rst b/doc/apps/ground.rst index 526acfc057..66830b5520 100644 --- a/doc/apps/ground.rst +++ b/doc/apps/ground.rst @@ -5,7 +5,7 @@ ground ******************************************************************************** The ``ground`` command is used to segment the input point cloud into ground -versus non-ground returns. +versus non-ground returns using :ref:`filters.smrf` and :ref:`filters.outlier`. :: @@ -13,17 +13,20 @@ versus non-ground returns. :: - --input, -i Input filename - --output, -o Output filename - --max_window_size Max window size - --slope Slope - --max_distance Max distance - --initial_distance Initial distance - --cell_size Cell size - --classify Apply classification labels? - --extract Extract ground returns? - --approximate, -a Use approximate algorithm? (much faster) - --reset Reset classification prior to segmentation. - --denoise Apply statistical outlier removal prior to segmentation. - - For more information, see the full documentation for PDAL at http://pdal.io/ + --input, -i Input filename + --output, -o Output filename + --max_window_size Max window size + --slope Slope + --max_distance Max distance + --initial_distance Initial distance + --cell_size Cell size + --extract Extract ground returns? + --reset Reset classifications prior to segmenting? + --denoise Apply statistical outlier removal prior to segmenting? + --returns Include last returns? + --scalar Elevation scalar? + --threshold Elevation threshold? + --cut Cut net size? + --ignore A range query to ignore when processing + + diff --git a/kernels/GroundKernel.cpp b/kernels/GroundKernel.cpp index a5830e7a9a..4ad6911bdc 100644 --- a/kernels/GroundKernel.cpp +++ b/kernels/GroundKernel.cpp @@ -73,14 +73,20 @@ void GroundKernel::addSwitches(ProgramArgs& args) { args.add("input,i", "Input filename", m_inputFile).setPositional(); args.add("output,o", "Output filename", m_outputFile).setPositional(); - args.add("max_window_size", "Max window size", m_maxWindowSize, 33.0); - args.add("slope", "Slope", m_slope, 1.0); + args.add("max_window_size", "Max window size", m_maxWindowSize, 18.0); + args.add("slope", "Slope", m_slope, 0.15); args.add("max_distance", "Max distance", m_maxDistance, 2.5); args.add("initial_distance", "Initial distance", m_initialDistance, .15); args.add("cell_size", "Cell size", m_cellSize, 1.0); args.add("extract", "Extract ground returns?", m_extract); args.add("reset", "Reset classifications prior to segmenting?", m_reset); args.add("denoise", "Apply statistical outlier removal prior to segmenting?", m_denoise); + args.add("returns", "Include last returns?", m_returns, + {"last", "only"}); + args.add("scalar", "Elevation scalar?", m_scalar, 1.25); + args.add("threshold", "Elevation threshold?", m_threshold, 0.5); + args.add("cut", "Cut net size?", m_cut, 0.0); + args.add("ignore", "A range query to ignore when processing", m_ignored); } int GroundKernel::execute() @@ -93,12 +99,16 @@ int GroundKernel::execute() Options outlierOptions; Options groundOptions; - groundOptions.add("max_window_size", m_maxWindowSize); + groundOptions.add("window", m_maxWindowSize); + groundOptions.add("threshold", m_threshold); groundOptions.add("slope", m_slope); - groundOptions.add("max_distance", m_maxDistance); - groundOptions.add("initial_distance", m_initialDistance); - groundOptions.add("cell_size", m_cellSize); - groundOptions.add("ignore", "Classification[7:7]"); + groundOptions.add("cell", m_cellSize); + groundOptions.add("cut", m_cut); + groundOptions.add("scalar", m_scalar); + for (auto& s: m_returns) + groundOptions.add("returns", s); + for(DimRange& r: m_ignored) + groundOptions.add("ignore", r); Options rangeOptions; rangeOptions.add("limits", "Classification[2:2]"); @@ -113,7 +123,8 @@ int GroundKernel::execute() if (m_denoise) outlierStage = &makeFilter("filters.outlier", *assignStage, outlierOptions); - Stage& groundStage = makeFilter("filters.pmf", *outlierStage, groundOptions); + Stage& groundStage = makeFilter("filters.smrf", *outlierStage, groundOptions); + Stage* rangeStage = &groundStage; if (m_extract) diff --git a/kernels/GroundKernel.hpp b/kernels/GroundKernel.hpp index 9db31ecd48..c824d37d74 100644 --- a/kernels/GroundKernel.hpp +++ b/kernels/GroundKernel.hpp @@ -38,7 +38,7 @@ #include #include #include - +#include "../filters/private/DimRange.hpp" #include #include @@ -60,6 +60,7 @@ class PDAL_DLL GroundKernel : public Kernel std::string m_inputFile; std::string m_outputFile; + std::string m_ignore; double m_maxWindowSize; double m_slope; double m_maxDistance; @@ -68,6 +69,13 @@ class PDAL_DLL GroundKernel : public Kernel bool m_extract; bool m_reset; bool m_denoise; + StringList m_returns; + double m_scalar; + double m_threshold; + double m_cut; + std::string m_dir; + std::vector m_ignored; + }; } // namespace pdal