LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_simplify_coverage.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 6 66.7 %
Date: 2026-06-03 12:46:18 Functions: 3 4 75.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             : *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "gdal vector simplify-coverage"
       5             :  * Author:   Daniel Baston
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2025, ISciences LLC
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #ifndef GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED
      14             : #define GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED
      15             : 
      16             : #include "gdalvectorpipelinestepalgorithm.h"
      17             : 
      18             : #include "cpl_progress.h"
      19             : 
      20             : #include <string>
      21             : 
      22             : //! @cond Doxygen_Suppress
      23             : 
      24             : /************************************************************************/
      25             : /*                 GDALVectorSimplifyCoverageAlgorithm                  */
      26             : /************************************************************************/
      27             : 
      28             : class GDALVectorSimplifyCoverageAlgorithm
      29             :     : public GDALVectorPipelineStepAlgorithm
      30             : {
      31             :   public:
      32             :     static constexpr const char *NAME = "simplify-coverage";
      33             :     static constexpr const char *DESCRIPTION =
      34             :         "Simplify shared boundaries of a polygonal vector dataset.";
      35             :     static constexpr const char *HELP_URL =
      36             :         "/programs/gdal_vector_simplify_coverage.html";
      37             : 
      38             :     explicit GDALVectorSimplifyCoverageAlgorithm(bool standaloneStep = false);
      39             : 
      40             :     struct Options
      41             :     {
      42             :         double tolerance = 0;
      43             :         bool preserveBoundary = false;
      44             :     };
      45             : 
      46           0 :     bool IsNativelyStreamingCompatible() const override
      47             :     {
      48           0 :         return false;
      49             :     }
      50             : 
      51             :   private:
      52             :     bool RunStep(GDALPipelineStepRunContext &ctxt) override;
      53             : 
      54             :     std::string m_activeLayer{};
      55             : 
      56             :     Options m_opts{};
      57             : };
      58             : 
      59             : /************************************************************************/
      60             : /*            GDALVectorSimplifyCoverageAlgorithmStandalone             */
      61             : /************************************************************************/
      62             : 
      63         108 : class GDALVectorSimplifyCoverageAlgorithmStandalone final
      64             :     : public GDALVectorSimplifyCoverageAlgorithm
      65             : {
      66             :   public:
      67          54 :     GDALVectorSimplifyCoverageAlgorithmStandalone()
      68          54 :         : GDALVectorSimplifyCoverageAlgorithm(/* standaloneStep = */ true)
      69             :     {
      70          54 :     }
      71             : 
      72             :     ~GDALVectorSimplifyCoverageAlgorithmStandalone() override;
      73             : };
      74             : 
      75             : //! @endcond
      76             : 
      77             : #endif /* GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED */

Generated by: LCOV version 1.14