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_update.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "raster update" subcommand
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_UPDATE_INCLUDED
14
#define GDALALG_RASTER_UPDATE_INCLUDED
15
16
#include "gdalalg_raster_pipeline.h"
17
18
#include "gdalalg_clip_common.h"
19
20
#include <limits>
21
22
//! @cond Doxygen_Suppress
23
24
/************************************************************************/
25
/*                      GDALRasterUpdateAlgorithm                       */
26
/************************************************************************/
27
28
class GDALRasterUpdateAlgorithm /* non final */
29
    : public GDALRasterPipelineStepAlgorithm,
30
      public GDALClipCommon
31
{
32
  public:
33
    static constexpr const char *NAME = "update";
34
    static constexpr const char *DESCRIPTION =
35
        "Update the destination raster with the content of the input one.";
36
    static constexpr const char *HELP_URL = "/programs/gdal_raster_update.html";
37
38
    explicit GDALRasterUpdateAlgorithm(bool standaloneStep = false);
39
40
    bool CanBeLastStep() const override
41
0
    {
42
0
        return true;
43
0
    }
44
45
    bool CanBeMiddleStep() const override
46
0
    {
47
0
        return true;
48
0
    }
49
50
    bool IsNativelyStreamingCompatible() const override
51
0
    {
52
0
        return false;
53
0
    }
54
55
    bool OutputDatasetAllowedBeforeRunningStep() const override
56
0
    {
57
0
        return true;
58
0
    }
59
60
  private:
61
    bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
62
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
63
64
    std::string m_resampling{};
65
    std::vector<std::string> m_warpOptions{};
66
    std::vector<std::string> m_transformOptions{};
67
    double m_errorThreshold = std::numeric_limits<double>::quiet_NaN();
68
    bool m_noUpdateOverviews = false;
69
};
70
71
/************************************************************************/
72
/*                 GDALRasterUpdateAlgorithmStandalone                  */
73
/************************************************************************/
74
75
class GDALRasterUpdateAlgorithmStandalone final
76
    : public GDALRasterUpdateAlgorithm
77
{
78
  public:
79
    GDALRasterUpdateAlgorithmStandalone()
80
0
        : GDALRasterUpdateAlgorithm(/* standaloneStep = */ true)
81
0
    {
82
0
    }
83
84
    ~GDALRasterUpdateAlgorithmStandalone() override;
85
};
86
87
//! @endcond
88
89
#endif