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