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