Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: gdal "raster" 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 "gdalalgorithm.h" 14 : 15 : #include "gdalalg_raster_buildvrt.h" 16 : #include "gdalalg_raster_info.h" 17 : #include "gdalalg_raster_clip.h" 18 : #include "gdalalg_raster_convert.h" 19 : #include "gdalalg_raster_edit.h" 20 : #include "gdalalg_raster_overview.h" 21 : #include "gdalalg_raster_pipeline.h" 22 : #include "gdalalg_raster_reproject.h" 23 : 24 : /************************************************************************/ 25 : /* GDALRasterAlgorithm */ 26 : /************************************************************************/ 27 : 28 : class GDALRasterAlgorithm final : public GDALAlgorithm 29 : { 30 : public: 31 : static constexpr const char *NAME = "raster"; 32 : static constexpr const char *DESCRIPTION = "Raster commands."; 33 : static constexpr const char *HELP_URL = "/programs/gdal_raster.html"; 34 : 35 1414 : static std::vector<std::string> GetAliases() 36 : { 37 1414 : return {}; 38 : } 39 : 40 168 : GDALRasterAlgorithm() : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL) 41 : { 42 168 : RegisterSubAlgorithm<GDALRasterInfoAlgorithm>(); 43 168 : RegisterSubAlgorithm<GDALRasterConvertAlgorithm>(); 44 168 : RegisterSubAlgorithm<GDALRasterClipAlgorithmStandalone>(); 45 168 : RegisterSubAlgorithm<GDALRasterEditAlgorithmStandalone>(); 46 168 : RegisterSubAlgorithm<GDALRasterOverviewAlgorithm>(); 47 168 : RegisterSubAlgorithm<GDALRasterPipelineAlgorithm>(); 48 168 : RegisterSubAlgorithm<GDALRasterReprojectAlgorithmStandalone>(); 49 168 : RegisterSubAlgorithm<GDALRasterBuildVRTAlgorithm>(); 50 168 : } 51 : 52 : private: 53 1 : bool RunImpl(GDALProgressFunc, void *) override 54 : { 55 1 : CPLError(CE_Failure, CPLE_AppDefined, 56 : "The Run() method should not be called directly on the \"gdal " 57 : "raster\" program."); 58 1 : return false; 59 : } 60 : }; 61 : 62 : GDAL_STATIC_REGISTER_ALG(GDALRasterAlgorithm);