/src/gdal/apps/gdalalg_vector_clip.h
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: GDAL |
4 | | * Purpose: "clip" step of "vector pipeline", or "gdal vector clip" standalone |
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_CLIP_INCLUDED |
14 | | #define GDALALG_VECTOR_CLIP_INCLUDED |
15 | | |
16 | | #include "gdalvectorpipelinestepalgorithm.h" |
17 | | |
18 | | #include "gdalalg_clip_common.h" |
19 | | |
20 | | //! @cond Doxygen_Suppress |
21 | | |
22 | | /************************************************************************/ |
23 | | /* GDALVectorClipAlgorithm */ |
24 | | /************************************************************************/ |
25 | | |
26 | | class GDALVectorClipAlgorithm /* non final */ |
27 | | : public GDALVectorPipelineStepAlgorithm, |
28 | | public GDALClipCommon |
29 | | { |
30 | | public: |
31 | | static constexpr const char *NAME = "clip"; |
32 | | static constexpr const char *DESCRIPTION = "Clip a vector dataset."; |
33 | | static constexpr const char *HELP_URL = "/programs/gdal_vector_clip.html"; |
34 | | |
35 | | explicit GDALVectorClipAlgorithm(bool standaloneStep = false); |
36 | | |
37 | | private: |
38 | | bool RunStep(GDALPipelineStepRunContext &ctxt) override; |
39 | | |
40 | | std::string m_activeLayer{}; |
41 | | }; |
42 | | |
43 | | /************************************************************************/ |
44 | | /* GDALVectorClipAlgorithmStandalone */ |
45 | | /************************************************************************/ |
46 | | |
47 | | class GDALVectorClipAlgorithmStandalone final : public GDALVectorClipAlgorithm |
48 | | { |
49 | | public: |
50 | | GDALVectorClipAlgorithmStandalone() |
51 | 0 | : GDALVectorClipAlgorithm(/* standaloneStep = */ true) |
52 | 0 | { |
53 | 0 | } |
54 | | |
55 | | ~GDALVectorClipAlgorithmStandalone() override; |
56 | | }; |
57 | | |
58 | | //! @endcond |
59 | | |
60 | | #endif /* GDALALG_VECTOR_CLIP_INCLUDED */ |