/src/gdal/apps/gdalalg_vector_explode.h
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: GDAL |
4 | | * Purpose: "explode" step of "vector pipeline" |
5 | | * Author: Daniel Baston |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2026, ISciences LLC |
9 | | * |
10 | | * SPDX-License-Identifier: MIT |
11 | | ****************************************************************************/ |
12 | | |
13 | | #ifndef GDALALG_VECTOR_EXPLODE_INCLUDED |
14 | | #define GDALALG_VECTOR_EXPLODE_INCLUDED |
15 | | |
16 | | #include "gdalalg_vector_pipeline.h" |
17 | | |
18 | | //! @cond Doxygen_Suppress |
19 | | |
20 | | /************************************************************************/ |
21 | | /* GDALVectorExplodeAlgorithm */ |
22 | | /************************************************************************/ |
23 | | |
24 | | class GDALVectorExplodeAlgorithm /* non final */ |
25 | | : public GDALVectorPipelineStepAlgorithm |
26 | | { |
27 | | public: |
28 | | static constexpr const char *NAME = "explode"; |
29 | | static constexpr const char *DESCRIPTION = |
30 | | "Explode fields or geometries of a vector dataset."; |
31 | | static constexpr const char *HELP_URL = |
32 | | "/programs/gdal_vector_explode.html"; |
33 | | |
34 | | explicit GDALVectorExplodeAlgorithm(bool standaloneStep = false); |
35 | | |
36 | | protected: |
37 | | bool RunStep(GDALPipelineStepRunContext &ctxt) override; |
38 | | |
39 | | private: |
40 | | std::string m_activeLayer{}; |
41 | | std::vector<std::string> m_fields{}; |
42 | | std::vector<std::string> m_geomFields{}; |
43 | | bool m_defaultGeom{false}; |
44 | | std::string m_indexFieldName{}; |
45 | | }; |
46 | | |
47 | | /************************************************************************/ |
48 | | /* GDALVectorExplodeAlgorithmStandalone */ |
49 | | /************************************************************************/ |
50 | | |
51 | | class GDALVectorExplodeAlgorithmStandalone final |
52 | | : public GDALVectorExplodeAlgorithm |
53 | | { |
54 | | public: |
55 | | GDALVectorExplodeAlgorithmStandalone() |
56 | 0 | : GDALVectorExplodeAlgorithm(/* standaloneStep = */ true) |
57 | 0 | { |
58 | 0 | } |
59 | | |
60 | | ~GDALVectorExplodeAlgorithmStandalone() override; |
61 | | }; |
62 | | |
63 | | //! @endcond |
64 | | |
65 | | #endif /* GDALALG_VECTOR_EXPLODE_INCLUDED */ |