GDAL

gdalalg_vector_explode_collections.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: "gdal vector explode-collections"
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_EXPLODE_COLLECTIONS_INCLUDED
14#define GDALALG_VECTOR_EXPLODE_COLLECTIONS_INCLUDED
15
16#include "gdalalg_vector_geom.h"
17
19
20/************************************************************************/
21/* GDALVectorExplodeCollectionsAlgorithm */
22/************************************************************************/
23
24 class GDALVectorExplodeCollectionsAlgorithm /* non final */
25 : public GDALVectorGeomAbstractAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "explode-collections";
29 static constexpr const char *DESCRIPTION =
30 "Explode geometries of type collection of a vector dataset.";
31 static constexpr const char *HELP_URL =
32 "/programs/gdal_vector_explode_collections.html";
33
34 struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
35 {
36 std::string m_type{};
37 bool m_skip = false;
38
39 // Computed value from m_type
40 OGRwkbGeometryType m_eType = wkbUnknown;
41 };
42
43 std::unique_ptr<OGRLayerWithTranslateFeature>
44 CreateAlgLayer(OGRLayer &srcLayer) override;
45
46 explicit GDALVectorExplodeCollectionsAlgorithm(bool standaloneStep = false);
47
48 private:
49 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
50
51 Options m_opts{};
52};
53
54/************************************************************************/
55/* GDALVectorExplodeCollectionsAlgorithmStandalone */
56/************************************************************************/
57
58 class GDALVectorExplodeCollectionsAlgorithmStandalone final
59 : public GDALVectorExplodeCollectionsAlgorithm
60{
61 public:
62 GDALVectorExplodeCollectionsAlgorithmStandalone()
63 : GDALVectorExplodeCollectionsAlgorithm(/* standaloneStep = */ true)
64 {
65 }
66
67 ~GDALVectorExplodeCollectionsAlgorithmStandalone() override;
68};
69
71
72#endif /* GDALALG_VECTOR_EXPLODE_COLLECTIONS_INCLUDED */
OGRLayer
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:61
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:405
wkbUnknown
@ wkbUnknown
unknown type, non-standard
Definition ogr_core.h:406