LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_select.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2026-08-22 15:37:05 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "select" step of "vector pipeline"
       5             :  * Author:   Even Rouault <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #ifndef GDALALG_VECTOR_SELECT_INCLUDED
      14             : #define GDALALG_VECTOR_SELECT_INCLUDED
      15             : 
      16             : #include "gdalvectorpipelinestepalgorithm.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                      GDALVectorSelectAlgorithm                       */
      22             : /************************************************************************/
      23             : 
      24             : class GDALVectorSelectAlgorithm /* non final */
      25             :     : public GDALVectorPipelineStepAlgorithm
      26             : {
      27             :   public:
      28             :     static constexpr const char *NAME = "select";
      29             :     static constexpr const char *DESCRIPTION =
      30             :         "Select a subset of fields from a vector dataset.";
      31             :     static constexpr const char *HELP_URL = "/programs/gdal_vector_select.html";
      32             : 
      33             :     explicit GDALVectorSelectAlgorithm(bool standaloneStep = false);
      34             : 
      35             :   private:
      36             :     bool RunStep(GDALPipelineStepRunContext &ctxt) override;
      37             : 
      38             :     std::string m_activeLayer{};
      39             :     std::vector<std::string> m_fieldsDeprecated{};
      40             :     std::vector<std::string> m_fields{};
      41             :     std::vector<std::string> m_geomFields{};
      42             :     bool m_defaultGeom = false;
      43             :     bool m_ignoreMissingFields = false;
      44             :     bool m_exclude = false;
      45             : };
      46             : 
      47             : /************************************************************************/
      48             : /*                 GDALVectorSelectAlgorithmStandalone                  */
      49             : /************************************************************************/
      50             : 
      51         132 : class GDALVectorSelectAlgorithmStandalone final
      52             :     : public GDALVectorSelectAlgorithm
      53             : {
      54             :   public:
      55          66 :     GDALVectorSelectAlgorithmStandalone()
      56          66 :         : GDALVectorSelectAlgorithm(/* standaloneStep = */ true)
      57             :     {
      58          66 :     }
      59             : 
      60             :     ~GDALVectorSelectAlgorithmStandalone() override;
      61             : };
      62             : 
      63             : //! @endcond
      64             : 
      65             : #endif /* GDALALG_VECTOR_SELECT_INCLUDED */

Generated by: LCOV version 1.14