Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_raster_select.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  "select" step of "raster pipeline"
5
 * Author:   Even Rouault <even dot rouault at spatialys.com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
9
 *
10
 * SPDX-License-Identifier: MIT
11
 ****************************************************************************/
12
13
#ifndef GDALALG_RASTER_SELECT_INCLUDED
14
#define GDALALG_RASTER_SELECT_INCLUDED
15
16
#include "gdalalg_raster_pipeline.h"
17
18
//! @cond Doxygen_Suppress
19
20
/************************************************************************/
21
/*                      GDALRasterSelectAlgorithm                       */
22
/************************************************************************/
23
24
class GDALRasterSelectAlgorithm /* non final */
25
    : public GDALRasterPipelineStepAlgorithm
26
{
27
  public:
28
    static constexpr const char *NAME = "select";
29
    static constexpr const char *DESCRIPTION =
30
        "Select a subset of bands from a raster dataset.";
31
    static constexpr const char *HELP_URL = "/programs/gdal_raster_select.html";
32
33
    explicit GDALRasterSelectAlgorithm(bool standaloneStep = false);
34
35
  private:
36
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
37
38
    std::vector<std::string> m_bands{};
39
    std::string m_mask{};
40
};
41
42
/************************************************************************/
43
/*                 GDALRasterSelectAlgorithmStandalone                  */
44
/************************************************************************/
45
46
class GDALRasterSelectAlgorithmStandalone final
47
    : public GDALRasterSelectAlgorithm
48
{
49
  public:
50
    GDALRasterSelectAlgorithmStandalone()
51
0
        : GDALRasterSelectAlgorithm(/* standaloneStep = */ true)
52
0
    {
53
0
    }
54
55
    ~GDALRasterSelectAlgorithmStandalone() override;
56
};
57
58
//! @endcond
59
60
#endif /* GDALALG_RASTER_SELECT_INCLUDED */