LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_edit.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 5 5 100.0 %
Date: 2025-01-18 12:42:00 Functions: 2 2 100.0 %

          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         228 :     static std::vector<std::string> GetAliases()
      33             :     {
      34         228 :         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             :     std::string m_overrideCrs{};
      45             :     std::vector<double> m_bbox{};
      46             :     std::vector<std::string> m_metadata{};
      47             :     std::vector<std::string> m_unsetMetadata{};
      48             : };
      49             : 
      50             : /************************************************************************/
      51             : /*                     GDALRasterEditAlgorithmStandalone                */
      52             : /************************************************************************/
      53             : 
      54             : class GDALRasterEditAlgorithmStandalone final : public GDALRasterEditAlgorithm
      55             : {
      56             :   public:
      57          15 :     GDALRasterEditAlgorithmStandalone()
      58          15 :         : GDALRasterEditAlgorithm(/* standaloneStep = */ true)
      59             :     {
      60          15 :     }
      61             : };
      62             : 
      63             : //! @endcond
      64             : 
      65             : #endif /* GDALALG_RASTER_EDIT_INCLUDED */

Generated by: LCOV version 1.14