GDAL

gdalalg_vector_layer_algebra.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "vector layer-algebra" subcommand
5 * Author: Even Rouault <even dot rouault at spatialys.com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_VECTOR_LAYER_ALGEBRA_INCLUDED
14#define GDALALG_VECTOR_LAYER_ALGEBRA_INCLUDED
15
16#include "gdalalgorithm.h"
17
18#include <limits>
19
21
22/************************************************************************/
23/* GDALVectorLayerAlgebraAlgorithm */
24/************************************************************************/
25
26 class GDALVectorLayerAlgebraAlgorithm final : public GDALAlgorithm
27{
28 public:
29 static constexpr const char *NAME = "layer-algebra";
30 static constexpr const char *DESCRIPTION =
31 "Perform algebraic operation between 2 layers.";
32 static constexpr const char *HELP_URL =
33 "/programs/gdal_vector_layer_algebra.html";
34
35 GDALVectorLayerAlgebraAlgorithm();
36
37 private:
38 std::string m_operation{};
39
40 std::vector<std::string> m_inputFormats{};
41 std::vector<std::string> m_openOptions{};
42 GDALArgDatasetValue m_inputDataset{};
43 GDALArgDatasetValue m_methodDataset{};
44 std::string m_inputLayerName{};
45 std::string m_methodLayerName{};
46
47 // Output arguments
48 GDALArgDatasetValue m_outputDataset{};
49 std::string m_format{};
50 std::vector<std::string> m_creationOptions{};
51 std::vector<std::string> m_layerCreationOptions{};
52 bool m_overwrite = false;
53 bool m_update = false;
54 bool m_overwriteLayer = false;
55 bool m_appendLayer = false;
56 std::string m_outputLayerName{};
57 std::string m_geometryType{};
58
59 std::string m_inputPrefix{};
60 std::vector<std::string> m_inputFields{};
61 bool m_noInputFields = false;
62 bool m_allInputFields = false;
63
64 std::string m_methodPrefix{};
65 std::vector<std::string> m_methodFields{};
66 bool m_noMethodFields = false;
67 bool m_allMethodFields = false;
68
69 bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
70};
71
73
74#endif
GDALAlgorithm
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2261
GDALArgDatasetValue
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:149