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 : explicit GDALRasterEditAlgorithm(bool standaloneStep = false); 33 : 34 : private: 35 : bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override; 36 : bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override; 37 : 38 : GDALArgDatasetValue m_dataset{}; // standalone mode only 39 : bool m_readOnly = false; // standalone mode only 40 : std::string m_overrideCrs{}; 41 : std::vector<double> m_bbox{}; 42 : std::vector<std::string> m_metadata{}; 43 : std::vector<std::string> m_unsetMetadata{}; 44 : std::string m_nodata{}; 45 : bool m_stats = false; // standalone mode only 46 : bool m_approxStats = false; // standalone mode only 47 : bool m_hist = false; // standalone mode only 48 : }; 49 : 50 : /************************************************************************/ 51 : /* GDALRasterEditAlgorithmStandalone */ 52 : /************************************************************************/ 53 : 54 : class GDALRasterEditAlgorithmStandalone final : public GDALRasterEditAlgorithm 55 : { 56 : public: 57 21 : GDALRasterEditAlgorithmStandalone() 58 21 : : GDALRasterEditAlgorithm(/* standaloneStep = */ true) 59 : { 60 21 : } 61 : }; 62 : 63 : //! @endcond 64 : 65 : #endif /* GDALALG_RASTER_EDIT_INCLUDED */