GDAL
gdalalg_vector_check_geometry.h
1/******************************************************************************
2*
3 * Project: GDAL
4 * Purpose: "gdal vector check-geometry"
5 * Author: Daniel Baston
6 *
7 ******************************************************************************
8 * Copyright (c) 2025, ISciences LLC
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_VECTOR_CHECK_GEOMETRY_INCLUDED
14#define GDALALG_VECTOR_CHECK_GEOMETRY_INCLUDED
15
16#include "gdalalg_vector_pipeline.h"
17#include "cpl_progress.h"
18
19#include <string>
20
22
23/************************************************************************/
24/* GDALVectorCheckGeometryAlgorithm */
25/************************************************************************/
26
27class GDALVectorCheckGeometryAlgorithm : public GDALVectorPipelineStepAlgorithm
28{
29 public:
30 static constexpr const char *NAME = "check-geometry";
31 static constexpr const char *DESCRIPTION =
32 "Check a dataset for invalid geometries";
33 static constexpr const char *HELP_URL =
34 "/programs/gdal_vector_check_geometry.html";
35
36 explicit GDALVectorCheckGeometryAlgorithm(bool standaloneStep = false);
37
38 private:
39 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
40
41 std::vector<std::string> m_includeFields{};
42 std::string m_geomField{};
43 bool m_includeValid{false};
44};
45
46/************************************************************************/
47/* GDALVectorCheckGeometryAlgorithmStandalone */
48/************************************************************************/
49
50class GDALVectorCheckGeometryAlgorithmStandalone final
51 : public GDALVectorCheckGeometryAlgorithm
52{
53 public:
54 GDALVectorCheckGeometryAlgorithmStandalone()
55 : GDALVectorCheckGeometryAlgorithm(/* standaloneStep = */ true)
56 {
57 }
58
59 ~GDALVectorCheckGeometryAlgorithmStandalone() override;
60};
61
63
64#endif /* GDALALG_VECTOR_CHECK_GEOMETRY_INCLUDED */