GDAL
gdalalg_vector_info.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "vector info" subcommand
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_INFO_INCLUDED
14#define GDALALG_VECTOR_INFO_INCLUDED
15
16#include "gdalalg_vector_pipeline.h"
17
19
20/************************************************************************/
21/* GDALVectorInfoAlgorithm */
22/************************************************************************/
23
24class GDALVectorInfoAlgorithm /* non final */
25 : public GDALVectorPipelineStepAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "info";
29 static constexpr const char *DESCRIPTION =
30 "Return information on a vector dataset.";
31 static constexpr const char *HELP_URL = "/programs/gdal_vector_info.html";
32
33 explicit GDALVectorInfoAlgorithm(bool standaloneStep = false);
34
35 bool CanBeLastStep() const override
36 {
37 return true;
38 }
39
40 private:
41 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
42
43 std::vector<std::string> m_layerNames{};
44 bool m_listFeatures = false;
45 bool m_summaryOnly = false;
46 std::string m_sql{};
47 std::string m_where{};
48 std::string m_dialect{};
49 int m_fid = -1;
50 int m_limit = 0;
51 std::string m_crsFormat = "AUTO";
52};
53
54/************************************************************************/
55/* GDALVectorInfoAlgorithmStandalone */
56/************************************************************************/
57
58class GDALVectorInfoAlgorithmStandalone final : public GDALVectorInfoAlgorithm
59{
60 public:
61 GDALVectorInfoAlgorithmStandalone()
62 : GDALVectorInfoAlgorithm(/* standaloneStep = */ true)
63 {
64 }
65
66 ~GDALVectorInfoAlgorithmStandalone() override;
67};
68
70
71#endif