13#ifndef GDALALG_PIPELINE_INCLUDED
14#define GDALALG_PIPELINE_INCLUDED
18#include "gdalalg_abstract_pipeline.h"
19#include "gdalalg_raster_pipeline.h"
20#include "gdalalg_vector_pipeline.h"
26class GDALAlgorithmStepRegistry final :
public GDALRasterAlgorithmStepRegistry,
27 public GDALVectorAlgorithmStepRegistry
30 GDALAlgorithmStepRegistry() =
default;
31 ~GDALAlgorithmStepRegistry()
override;
35 template <
class MyAlgorithm>
36 bool Register(
const std::string &name = std::string())
38 static_assert(std::is_base_of_v<GDALPipelineStepAlgorithm, MyAlgorithm>,
39 "Algorithm is not a GDALPipelineStepAlgorithm");
42 info.m_name = name.empty() ? MyAlgorithm::NAME : name;
43 info.m_aliases = MyAlgorithm::GetAliasesStatic();
44 info.m_creationFunc = []() -> std::unique_ptr<GDALAlgorithm>
45 {
return std::make_unique<MyAlgorithm>(); };
54class GDALPipelineAlgorithm final :
public GDALAbstractPipelineAlgorithm
58 static constexpr const char *NAME =
"pipeline";
59 static constexpr const char *DESCRIPTION =
60 "Process a dataset applying several steps.";
61 static constexpr const char *HELP_URL =
"/programs/gdal_pipeline.html";
63 static std::vector<std::string> GetAliasesStatic()
66#ifdef GDAL_PIPELINE_PROJ_NOSTALGIA
74 GDALPipelineAlgorithm();
76 int GetInputType()
const override
81 int GetOutputType()
const override
87 GDALAlgorithmStepRegistry m_stepRegistry{};
89 GDALAlgorithmRegistry &GetStepRegistry()
override
91 return m_stepRegistry;
94 const GDALAlgorithmRegistry &GetStepRegistry()
const override
96 return m_stepRegistry;
99 std::string GetUsageForCLI(
bool shortUsage,
100 const UsageOptions &usageOptions)
const override;
103 std::unique_ptr<GDALAbstractPipelineAlgorithm>
104 CreateNestedPipeline()
const override
106 auto pipeline = std::make_unique<GDALPipelineAlgorithm>();
107 pipeline->m_bInnerPipeline =
true;
static constexpr const char * HIDDEN_ALIAS_SEPARATOR
Special value to put in m_aliases to separate public alias from hidden aliases.
Definition gdalalgorithm_cpp.h:2136
bool Register()
Register the algorithm of type MyAlgorithm.
Definition gdalalgorithm_cpp.h:2159
#define GDAL_OF_RASTER
Allow raster drivers to be used.
Definition gdal.h:1086
#define GDAL_OF_VECTOR
Allow vector drivers to be used.
Definition gdal.h:1091