Coverage Report

Created: 2026-04-10 07:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_raster_edit.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  "edit" step of "raster 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_RASTER_EDIT_INCLUDED
14
#define GDALALG_RASTER_EDIT_INCLUDED
15
16
#include "gdalalg_raster_pipeline.h"
17
18
namespace gdal
19
{
20
class GCP;
21
}
22
23
//! @cond Doxygen_Suppress
24
25
/************************************************************************/
26
/*                       GDALRasterEditAlgorithm                        */
27
/************************************************************************/
28
29
class GDALRasterEditAlgorithm /* non final */
30
    : public GDALRasterPipelineStepAlgorithm
31
{
32
  public:
33
    static constexpr const char *NAME = "edit";
34
    static constexpr const char *DESCRIPTION = "Edit a raster dataset.";
35
    static constexpr const char *HELP_URL = "/programs/gdal_raster_edit.html";
36
37
    explicit GDALRasterEditAlgorithm(bool standaloneStep = false);
38
    ~GDALRasterEditAlgorithm() override;
39
40
  private:
41
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
42
    std::vector<gdal::GCP> ParseGCPs() const;
43
44
    GDALArgDatasetValue m_dataset{};  // standalone mode only
45
    bool m_readOnly = false;          // standalone mode only
46
    std::string m_overrideCrs{};
47
    std::vector<double> m_bbox{};
48
    std::vector<std::string> m_metadata{};
49
    std::vector<std::string> m_unsetMetadata{};
50
    std::vector<std::string> m_unsetMetadataDomain{};
51
    std::vector<std::string> m_colorInterpretation{};
52
    std::vector<std::string> m_scale{};
53
    std::vector<std::string> m_offset{};
54
    std::string m_nodata{};
55
    std::vector<std::string> m_gcps{};
56
    bool m_stats = false;        // standalone mode only
57
    bool m_approxStats = false;  // standalone mode only
58
    bool m_hist = false;         // standalone mode only
59
};
60
61
/************************************************************************/
62
/*                  GDALRasterEditAlgorithmStandalone                   */
63
/************************************************************************/
64
65
class GDALRasterEditAlgorithmStandalone final : public GDALRasterEditAlgorithm
66
{
67
  public:
68
    GDALRasterEditAlgorithmStandalone()
69
0
        : GDALRasterEditAlgorithm(/* standaloneStep = */ true)
70
0
    {
71
0
    }
72
73
    ~GDALRasterEditAlgorithmStandalone() override;
74
};
75
76
//! @endcond
77
78
#endif /* GDALALG_RASTER_EDIT_INCLUDED */