Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: gdal "vector" 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_vector_info.h" 16 : #include "gdalalg_vector_convert.h" 17 : #include "gdalalg_vector_pipeline.h" 18 : #include "gdalalg_vector_filter.h" 19 : #include "gdalalg_vector_reproject.h" 20 : 21 : /************************************************************************/ 22 : /* GDALVectorAlgorithm */ 23 : /************************************************************************/ 24 : 25 : class GDALVectorAlgorithm final : public GDALAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "vector"; 29 : static constexpr const char *DESCRIPTION = "Vector commands."; 30 : static constexpr const char *HELP_URL = "/programs/gdal_vector.html"; 31 : 32 1414 : static std::vector<std::string> GetAliases() 33 : { 34 1414 : return {}; 35 : } 36 : 37 85 : GDALVectorAlgorithm() : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL) 38 : { 39 85 : RegisterSubAlgorithm<GDALVectorInfoAlgorithm>(); 40 85 : RegisterSubAlgorithm<GDALVectorConvertAlgorithm>(); 41 85 : RegisterSubAlgorithm<GDALVectorPipelineAlgorithm>(); 42 85 : RegisterSubAlgorithm<GDALVectorFilterAlgorithmStandalone>(); 43 85 : RegisterSubAlgorithm<GDALVectorReprojectAlgorithmStandalone>(); 44 85 : } 45 : 46 : private: 47 1 : bool RunImpl(GDALProgressFunc, void *) override 48 : { 49 1 : CPLError(CE_Failure, CPLE_AppDefined, 50 : "The Run() method should not be called directly on the \"gdal " 51 : "vector\" program."); 52 1 : return false; 53 : } 54 : }; 55 : 56 : GDAL_STATIC_REGISTER_ALG(GDALVectorAlgorithm);