LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_convert.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 15 16 93.8 %
Date: 2025-10-21 22:35:35 Functions: 2 2 100.0 %

          Line data    Source code
       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          50 : GDALRasterConvertAlgorithm::GDALRasterConvertAlgorithm(
      22          50 :     bool /* standalone */, bool openForMixedRasterVector)
      23             :     : GDALRasterPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL,
      24           0 :                                       ConstructorOptions()
      25          50 :                                           .SetStandaloneStep(true)
      26          50 :                                           .SetInputDatasetMaxCount(1)
      27         100 :                                           .SetAddDefaultArguments(false))
      28             : {
      29          50 :     AddRasterInputArgs(openForMixedRasterVector, false);
      30          50 :     AddProgressArg();
      31          50 :     AddRasterOutputArgs(false);
      32          50 : }
      33             : 
      34             : /************************************************************************/
      35             : /*                  GDALRasterConvertAlgorithm::RunImpl()               */
      36             : /************************************************************************/
      37             : 
      38          14 : bool GDALRasterConvertAlgorithm::RunStep(GDALPipelineStepRunContext &)
      39             : {
      40             :     // Do nothing but forwarding the input dataset to the output. Real job
      41             :     // is done by GDALVectorWrite.
      42          14 :     CPLAssert(m_inputDataset.size() == 1);
      43          14 :     auto poSrcDS = m_inputDataset[0].GetDatasetRef();
      44          14 :     CPLAssert(poSrcDS);
      45             : 
      46          14 :     m_outputDataset.Set(poSrcDS);
      47             : 
      48          14 :     return true;
      49             : }
      50             : 
      51             : //! @endcond

Generated by: LCOV version 1.14