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_convert.cpp
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "raster convert" subcommand
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
#include "gdalalg_raster_convert.h"
14
15
//! @cond Doxygen_Suppress
16
17
/************************************************************************/
18
/*       GDALRasterConvertAlgorithm::GDALRasterConvertAlgorithm()       */
19
/************************************************************************/
20
21
GDALRasterConvertAlgorithm::GDALRasterConvertAlgorithm(
22
    bool /* standalone */, bool openForMixedRasterVector)
23
0
    : GDALRasterPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL,
24
0
                                      ConstructorOptions()
25
0
                                          .SetStandaloneStep(true)
26
0
                                          .SetInputDatasetMaxCount(1)
27
0
                                          .SetAddDefaultArguments(false))
28
0
{
29
0
    AddRasterInputArgs(openForMixedRasterVector, false);
30
0
    AddProgressArg();
31
0
    AddRasterOutputArgs(false);
32
0
}
33
34
/************************************************************************/
35
/*                GDALRasterConvertAlgorithm::RunImpl()                 */
36
/************************************************************************/
37
38
bool GDALRasterConvertAlgorithm::RunStep(GDALPipelineStepRunContext &)
39
0
{
40
    // Do nothing but forwarding the input dataset to the output. Real job
41
    // is done by GDALVectorWrite.
42
0
    CPLAssert(m_inputDataset.size() == 1);
43
0
    auto poSrcDS = m_inputDataset[0].GetDatasetRef();
44
0
    CPLAssert(poSrcDS);
45
46
0
    m_outputDataset.Set(poSrcDS);
47
48
0
    return true;
49
0
}
50
51
//! @endcond