Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_vector_segmentize.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  "gdal vector segmentize"
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_SEGMENTIZE_INCLUDED
14
#define GDALALG_VECTOR_SEGMENTIZE_INCLUDED
15
16
#include "gdalalg_vector_geom.h"
17
18
//! @cond Doxygen_Suppress
19
20
/************************************************************************/
21
/*                    GDALVectorSegmentizeAlgorithm                     */
22
/************************************************************************/
23
24
class GDALVectorSegmentizeAlgorithm /* non final */
25
    : public GDALVectorGeomAbstractAlgorithm
26
{
27
  public:
28
    static constexpr const char *NAME = "segmentize";
29
    static constexpr const char *DESCRIPTION =
30
        "Segmentize geometries of a vector dataset.";
31
    static constexpr const char *HELP_URL =
32
        "/programs/gdal_vector_segmentize.html";
33
34
    struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
35
    {
36
        double m_maxLength = 0;
37
    };
38
39
    std::unique_ptr<OGRLayerWithTranslateFeature>
40
    CreateAlgLayer(OGRLayer &srcLayer) override;
41
42
    explicit GDALVectorSegmentizeAlgorithm(bool standaloneStep = false);
43
44
  private:
45
    Options m_opts{};
46
};
47
48
/************************************************************************/
49
/*               GDALVectorSegmentizeAlgorithmStandalone                */
50
/************************************************************************/
51
52
class GDALVectorSegmentizeAlgorithmStandalone final
53
    : public GDALVectorSegmentizeAlgorithm
54
{
55
  public:
56
    GDALVectorSegmentizeAlgorithmStandalone()
57
0
        : GDALVectorSegmentizeAlgorithm(/* standaloneStep = */ true)
58
0
    {
59
0
    }
60
61
    ~GDALVectorSegmentizeAlgorithmStandalone() override;
62
};
63
64
//! @endcond
65
66
#endif /* GDALALG_VECTOR_SEGMENTIZE_INCLUDED */