Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "edit" 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 : #ifndef GDALALG_RASTER_EDIT_INCLUDED 14 : #define GDALALG_RASTER_EDIT_INCLUDED 15 : 16 : #include "gdalalg_raster_pipeline.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALRasterEditAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class GDALRasterEditAlgorithm /* non final */ 25 : : public GDALRasterPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "edit"; 29 : static constexpr const char *DESCRIPTION = "Edit a raster dataset."; 30 : static constexpr const char *HELP_URL = "/programs/gdal_raster_edit.html"; 31 : 32 378 : static std::vector<std::string> GetAliases() 33 : { 34 378 : return {}; 35 : } 36 : 37 : explicit GDALRasterEditAlgorithm(bool standaloneStep = false); 38 : 39 : private: 40 : bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override; 41 : bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override; 42 : 43 : GDALArgDatasetValue m_dataset{}; // standalone mode only 44 : bool m_readOnly = false; // standalone mode only 45 : std::string m_overrideCrs{}; 46 : std::vector<double> m_bbox{}; 47 : std::vector<std::string> m_metadata{}; 48 : std::vector<std::string> m_unsetMetadata{}; 49 : bool m_stats = false; // standalone mode only 50 : bool m_approxStats = false; // standalone mode only 51 : bool m_hist = false; // standalone mode only 52 : }; 53 : 54 : /************************************************************************/ 55 : /* GDALRasterEditAlgorithmStandalone */ 56 : /************************************************************************/ 57 : 58 : class GDALRasterEditAlgorithmStandalone final : public GDALRasterEditAlgorithm 59 : { 60 : public: 61 18 : GDALRasterEditAlgorithmStandalone() 62 18 : : GDALRasterEditAlgorithm(/* standaloneStep = */ true) 63 : { 64 18 : } 65 : }; 66 : 67 : //! @endcond 68 : 69 : #endif /* GDALALG_RASTER_EDIT_INCLUDED */