GDAL

gdalalg_vector_index.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "vector index" subcommand
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_INDEX_INCLUDED
14#define GDALALG_VECTOR_INDEX_INCLUDED
15
16#include "gdalalg_vector_output_abstract.h"
17
19
20/************************************************************************/
21/* GDALVectorIndexAlgorithm */
22/************************************************************************/
23
24 class CPL_DLL GDALVectorIndexAlgorithm final
25 : public GDALVectorOutputAbstractAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "index";
29 static constexpr const char *DESCRIPTION =
30 "Create a vector index of vector datasets.";
31 static constexpr const char *HELP_URL = "/programs/gdal_vector_index.html";
32
33 GDALVectorIndexAlgorithm();
34
35 private:
36 bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
37
38 std::vector<GDALArgDatasetValue> m_inputDatasets{};
39 bool m_recursive = false;
40 std::vector<std::string> m_filenameFilter{};
41 std::string m_locationName = "location";
42 bool m_writeAbsolutePaths = false;
43 std::string m_crs{};
44 std::string m_sourceCrsName{};
45 std::string m_sourceCrsFormat = "auto";
46 std::vector<std::string> m_metadata{};
47 std::vector<std::string> m_layerNames{};
48 std::vector<int> m_layerIndices{};
49 bool m_datasetNameOnly = false;
50 bool m_skipDifferentCRS = false; // for compatibility with ogrtindex
51 bool m_acceptDifferentCRS = false;
52 bool m_acceptDifferentSchemas = false;
53 bool m_calledFromOgrTIndex = false;
54};
55
57
58#endif