GDAL

gdalalg_vector_swap_xy.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: "gdal vector swap-xy"
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_SWAP_XY_INCLUDED
14#define GDALALG_VECTOR_SWAP_XY_INCLUDED
15
16#include "gdalalg_vector_geom.h"
17
19
20/************************************************************************/
21/* GDALVectorSwapXYAlgorithm */
22/************************************************************************/
23
24 class GDALVectorSwapXYAlgorithm /* non final */
25 : public GDALVectorGeomAbstractAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "swap-xy";
29 static constexpr const char *DESCRIPTION =
30 "Swap X and Y coordinates of geometries of a vector dataset.";
31 static constexpr const char *HELP_URL =
32 "/programs/gdal_vector_swap_xy.html";
33
34 struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
35 {
36 };
37
38 std::unique_ptr<OGRLayerWithTranslateFeature>
39 CreateAlgLayer(OGRLayer &srcLayer) override;
40
41 explicit GDALVectorSwapXYAlgorithm(bool standaloneStep = false);
42
43 private:
44 Options m_opts{};
45};
46
47/************************************************************************/
48/* GDALVectorSwapXYAlgorithmStandalone */
49/************************************************************************/
50
51 class GDALVectorSwapXYAlgorithmStandalone final
52 : public GDALVectorSwapXYAlgorithm
53{
54 public:
55 GDALVectorSwapXYAlgorithmStandalone()
56 : GDALVectorSwapXYAlgorithm(/* standaloneStep = */ true)
57 {
58 }
59
60 ~GDALVectorSwapXYAlgorithmStandalone() override;
61};
62
64
65#endif /* GDALALG_VECTOR_SWAP_XY_INCLUDED */
OGRLayer
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:61