GDAL

gdalalg_vector_filter.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: "filter" step of "vector pipeline"
5 * Author: Even Rouault <even dot rouault at spatialys.com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_VECTOR_FILTER_INCLUDED
14#define GDALALG_VECTOR_FILTER_INCLUDED
15
16#include "gdalalg_vector_pipeline.h"
17
19
20/************************************************************************/
21/* GDALVectorFilterAlgorithm */
22/************************************************************************/
23
24 class GDALVectorFilterAlgorithm /* non final */
25 : public GDALVectorPipelineStepAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "filter";
29 static constexpr const char *DESCRIPTION = "Filter a vector dataset.";
30 static constexpr const char *HELP_URL = "/programs/gdal_vector_filter.html";
31
32 explicit GDALVectorFilterAlgorithm(bool standaloneStep = false);
33
34 private:
35 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
36
37 std::string m_activeLayer{};
38 std::vector<double> m_bbox{};
39 std::string m_where{};
40};
41
42/************************************************************************/
43/* GDALVectorFilterAlgorithmStandalone */
44/************************************************************************/
45
46 class GDALVectorFilterAlgorithmStandalone final
47 : public GDALVectorFilterAlgorithm
48{
49 public:
50 GDALVectorFilterAlgorithmStandalone()
51 : GDALVectorFilterAlgorithm(/* standaloneStep = */ true)
52 {
53 }
54
55 ~GDALVectorFilterAlgorithmStandalone() override;
56};
57
59
60#endif /* GDALALG_VECTOR_FILTER_INCLUDED */