GDAL

gdalalg_raster_tri.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: "tri" 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_TRI_INCLUDED
14#define GDALALG_RASTER_TRI_INCLUDED
15
16#include "gdalalg_raster_pipeline.h"
17
18#include <limits>
19
21
22/************************************************************************/
23/* GDALRasterTRIAlgorithm */
24/************************************************************************/
25
26 class GDALRasterTRIAlgorithm /* non final */
27 : public GDALRasterPipelineStepAlgorithm
28{
29 public:
30 static constexpr const char *NAME = "tri";
31 static constexpr const char *DESCRIPTION =
32 "Generate a Terrain Ruggedness Index (TRI) map";
33 static constexpr const char *HELP_URL = "/programs/gdal_raster_tri.html";
34
35 explicit GDALRasterTRIAlgorithm(bool standaloneStep = false);
36
37 private:
38 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
39
40 int m_band = 1;
41 std::string m_algorithm = "Riley";
42 bool m_noEdges = false;
43};
44
45/************************************************************************/
46/* GDALRasterTRIAlgorithmStandalone */
47/************************************************************************/
48
49 class GDALRasterTRIAlgorithmStandalone final : public GDALRasterTRIAlgorithm
50{
51 public:
52 GDALRasterTRIAlgorithmStandalone()
53 : GDALRasterTRIAlgorithm(/* standaloneStep = */ true)
54 {
55 }
56
57 ~GDALRasterTRIAlgorithmStandalone() override;
58};
59
61
62#endif /* GDALALG_RASTER_TRI_INCLUDED */