Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_raster_tpi.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  "tpi" step of "raster pipeline"
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_RASTER_TPI_INCLUDED
14
#define GDALALG_RASTER_TPI_INCLUDED
15
16
#include "gdalalg_raster_pipeline.h"
17
18
#include <limits>
19
20
//! @cond Doxygen_Suppress
21
22
/************************************************************************/
23
/*                        GDALRasterTPIAlgorithm                        */
24
/************************************************************************/
25
26
class GDALRasterTPIAlgorithm /* non final */
27
    : public GDALRasterPipelineStepAlgorithm
28
{
29
  public:
30
    static constexpr const char *NAME = "tpi";
31
    static constexpr const char *DESCRIPTION =
32
        "Generate a Topographic Position Index (TPI) map";
33
    static constexpr const char *HELP_URL = "/programs/gdal_raster_tpi.html";
34
35
    explicit GDALRasterTPIAlgorithm(bool standaloneStep = false);
36
37
  private:
38
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
39
40
    int m_band = 1;
41
    bool m_noEdges = false;
42
};
43
44
/************************************************************************/
45
/*                   GDALRasterTPIAlgorithmStandalone                   */
46
/************************************************************************/
47
48
class GDALRasterTPIAlgorithmStandalone final : public GDALRasterTPIAlgorithm
49
{
50
  public:
51
    GDALRasterTPIAlgorithmStandalone()
52
0
        : GDALRasterTPIAlgorithm(/* standaloneStep = */ true)
53
0
    {
54
0
    }
55
56
    ~GDALRasterTPIAlgorithmStandalone() override;
57
};
58
59
//! @endcond
60
61
#endif /* GDALALG_RASTER_TPI_INCLUDED */