Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "read" step of "raster pipeline" 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_read.h" 14 : 15 : #include "gdal_priv.h" 16 : #include "ogrsf_frmts.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALRasterReadAlgorithm::GDALRasterReadAlgorithm() */ 22 : /************************************************************************/ 23 : 24 415 : GDALRasterReadAlgorithm::GDALRasterReadAlgorithm(bool openForMixedRasterVector) 25 : : GDALRasterPipelineStepAlgorithm( 26 : NAME, DESCRIPTION, HELP_URL, 27 415 : ConstructorOptions().SetAddDefaultArguments(false)) 28 : { 29 415 : AddRasterInputArgs(openForMixedRasterVector, 30 : /* hiddenForCLI = */ false); 31 415 : } 32 : 33 : /************************************************************************/ 34 : /* GDALRasterReadAlgorithm::RunStep() */ 35 : /************************************************************************/ 36 : 37 338 : bool GDALRasterReadAlgorithm::RunStep(GDALPipelineStepRunContext &) 38 : { 39 338 : const auto poSrcDS = m_inputDataset[0].GetDatasetRef(); 40 338 : CPLAssert(poSrcDS); 41 338 : CPLAssert(m_outputDataset.GetName().empty()); 42 338 : CPLAssert(!m_outputDataset.GetDatasetRef()); 43 : 44 338 : m_outputDataset.Set(poSrcDS); 45 : 46 338 : return true; 47 : } 48 : 49 : //! @endcond