GDAL
gdalalg_raster_viewshed.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "raster viewshed" subcommand
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_VIEWSHED_INCLUDED
14#define GDALALG_RASTER_VIEWSHED_INCLUDED
15
16#include "gdalalg_raster_pipeline.h"
17#include "viewshed/viewshed_types.h"
18
20
21/************************************************************************/
22/* GDALRasterViewshedAlgorithm */
23/************************************************************************/
24
25class GDALRasterViewshedAlgorithm /* non final */
26 : public GDALRasterPipelineNonNativelyStreamingAlgorithm
27{
28 public:
29 static constexpr const char *NAME = "viewshed";
30 static constexpr const char *DESCRIPTION =
31 "Compute the viewshed of a raster dataset.";
32 static constexpr const char *HELP_URL =
33 "/programs/gdal_raster_viewshed.html";
34
35 explicit GDALRasterViewshedAlgorithm(bool standaloneStep = false);
36
37 private:
38 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
39
40 std::vector<double> m_observerPos{};
42
43 std::string m_outputMode = "normal";
44 int m_band = 1;
45 int m_numThreads = 3;
46 GDALArgDatasetValue m_sdFilename{};
47
48 // Work variables
49 std::string m_numThreadsStr{};
50};
51
52/************************************************************************/
53/* GDALRasterViewshedAlgorithmStandalone */
54/************************************************************************/
55
56class GDALRasterViewshedAlgorithmStandalone final
57 : public GDALRasterViewshedAlgorithm
58{
59 public:
60 GDALRasterViewshedAlgorithmStandalone()
61 : GDALRasterViewshedAlgorithm(/* standaloneStep = */ true)
62 {
63 }
64
65 ~GDALRasterViewshedAlgorithmStandalone() override;
66};
67
69
70#endif
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:163
Options for viewshed generation.
Definition viewshed_types.h:59