23#include "viewshed_types.h"
35 std::vector<double>
cur;
62 int nY,
const Window &oOutExtent,
const Window &oCurExtent,
64 bool emitWarningIfNoData);
70 return m_hasFoundNoData;
77 double m_noDataValue = 0;
78 bool m_hasNoData =
false;
79 bool m_emitWarningIfNoData =
false;
80 bool m_hasFoundNoData =
false;
87 double m_dfHeightAdjFactor{0};
88 double m_dfMinDistance2;
89 double m_dfMaxDistance2;
90 double m_dfZObserver{0};
93 GDALGeoTransform m_gt{};
94 std::array<double, 5> m_testAngle{};
95 double m_lowTanPitch{std::numeric_limits<double>::quiet_NaN()};
96 double m_highTanPitch{std::numeric_limits<double>::quiet_NaN()};
97 double (*oZcalc)(int, int, double, double, double){};
99 double calcHeightAdjFactor();
100 void setOutput(
double &dfResult,
double &dfCellVal,
double dfZ);
101 bool readLine(
int nLine, std::vector<double> &line);
102 bool writeLine(
int nLine, std::vector<double> &vResult);
103 bool processLine(
int nLine, Lines &lines);
104 bool processFirstLine(Lines &lines);
105 void processFirstLineLeft(
const LineLimits &ll, Lines &lines);
106 void processFirstLineRight(
const LineLimits &ll, Lines &lines);
107 void processFirstLineTopOrBottom(
const LineLimits &ll, Lines &lines);
108 void processLineLeft(
int nYOffset, LineLimits &ll, Lines &lines);
109 void processLineRight(
int nYOffset, LineLimits &ll, Lines &lines);
110 LineLimits adjustHeight(
int iLine, Lines &lines);
111 void maskInitial(std::vector<double> &vResult,
int nLine);
112 bool maskAngleLeft(std::vector<double> &vResult,
int nLine);
113 bool maskAngleRight(std::vector<double> &vResult,
int nLine);
114 void maskLineLeft(std::vector<double> &vResult,
const LineLimits &ll,
116 void maskLineRight(std::vector<double> &vResult,
const LineLimits &ll,
118 void calcPitchMask(
double dfZ,
double dfDist,
double dfResult,
120 void applyPitchMask(std::vector<double> &vResult,
121 const std::vector<double> &vPitchMaskVal);
122 void calcTestAngles();
Pool of worker threads.
Definition cpl_worker_thread_pool.h:64
A single raster band (or channel).
Definition gdal_rasterband.h:105
Support for progress reporting in viewshed construction.
Definition progress.h:23
bool run()
Run the viewshed computation.
Definition viewshed_executor.cpp:954
ViewshedExecutor(GDALRasterBand &srcBand, GDALRasterBand &dstBand, int nX, int nY, const Window &oOutExtent, const Window &oCurExtent, const Options &opts, Progress &oProgress, bool emitWarningIfNoData)
Constructor - the viewshed algorithm executor.
Definition viewshed_executor.cpp:125
bool hasFoundNoData() const
Return whether an input pixel is at the nodata value.
Definition viewshed_executor.h:68
Class to manage a pool of worker threads.
This file is legacy since GDAL 3.12, but will be kept at least in the whole GDAL 3....
Lines()
Constructor.
Definition viewshed_executor.h:42
std::vector< double > prev
Height values for previous line.
Definition viewshed_executor.h:37
std::vector< double > pitchMask
Height/indicator values for pitch masking.
Definition viewshed_executor.h:39
std::vector< double > cur
Current line being processed.
Definition viewshed_executor.h:35
Lines(size_t lineLen)
Constructor that initializes to line length.
Definition viewshed_executor.h:48
std::vector< double > result
Result values for current line.
Definition viewshed_executor.h:36
Options for viewshed generation.
Definition viewshed_types.h:59
A window in a raster including pixels in [xStart, xStop) and [yStart, yStop).
Definition viewshed_types.h:116