/src/gdal/apps/gdalalg_vector_simplify_coverage.h
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: GDAL |
4 | | * Purpose: "gdal vector simplify-coverage" |
5 | | * Author: Daniel Baston |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2025, ISciences LLC |
9 | | * |
10 | | * SPDX-License-Identifier: MIT |
11 | | ****************************************************************************/ |
12 | | |
13 | | #ifndef GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED |
14 | | #define GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED |
15 | | |
16 | | #include "gdalalg_vector_pipeline.h" |
17 | | #include "cpl_progress.h" |
18 | | |
19 | | #include <string> |
20 | | |
21 | | //! @cond Doxygen_Suppress |
22 | | |
23 | | /************************************************************************/ |
24 | | /* GDALVectorSimplifyCoverageAlgorithm */ |
25 | | /************************************************************************/ |
26 | | |
27 | | class GDALVectorSimplifyCoverageAlgorithm |
28 | | : public GDALVectorPipelineStepAlgorithm |
29 | | { |
30 | | public: |
31 | | static constexpr const char *NAME = "simplify-coverage"; |
32 | | static constexpr const char *DESCRIPTION = |
33 | | "Simplify shared boundaries of a polygonal vector dataset."; |
34 | | static constexpr const char *HELP_URL = |
35 | | "/programs/gdal_vector_simplify_coverage.html"; |
36 | | |
37 | | explicit GDALVectorSimplifyCoverageAlgorithm(bool standaloneStep = false); |
38 | | |
39 | | struct Options |
40 | | { |
41 | | double tolerance = 0; |
42 | | bool preserveBoundary = false; |
43 | | }; |
44 | | |
45 | | bool IsNativelyStreamingCompatible() const override |
46 | 0 | { |
47 | 0 | return false; |
48 | 0 | } |
49 | | |
50 | | private: |
51 | | bool RunStep(GDALPipelineStepRunContext &ctxt) override; |
52 | | |
53 | | std::string m_activeLayer{}; |
54 | | |
55 | | Options m_opts{}; |
56 | | }; |
57 | | |
58 | | /************************************************************************/ |
59 | | /* GDALVectorSimplifyCoverageAlgorithmStandalone */ |
60 | | /************************************************************************/ |
61 | | |
62 | | class GDALVectorSimplifyCoverageAlgorithmStandalone final |
63 | | : public GDALVectorSimplifyCoverageAlgorithm |
64 | | { |
65 | | public: |
66 | | GDALVectorSimplifyCoverageAlgorithmStandalone() |
67 | 0 | : GDALVectorSimplifyCoverageAlgorithm(/* standaloneStep = */ true) |
68 | 0 | { |
69 | 0 | } |
70 | | |
71 | | ~GDALVectorSimplifyCoverageAlgorithmStandalone() override; |
72 | | }; |
73 | | |
74 | | //! @endcond |
75 | | |
76 | | #endif /* GDALALG_VECTOR_SIMPLIFY_COVERAGE_INCLUDED */ |