23#include "viewshed_types.h"
35 std::vector<double>
cur;
41 std::vector<double>
sd;
60 CPLErr IReadBlock(
int,
int,
void *)
override;
75 bool emitWarningIfNoData);
78 int nY,
const Window &oOutExtent,
const Window &oCurExtent,
80 bool emitWarningIfNoData);
86 return m_hasFoundNoData;
91 DummyBand m_dummyBand;
95 const bool m_hasSdBand;
96 double m_noDataValue = 0;
97 bool m_hasNoData =
false;
98 bool m_emitWarningIfNoData =
false;
99 bool m_hasFoundNoData =
false;
106 double m_dfHeightAdjFactor{0};
107 double m_dfMinDistance2;
108 double m_dfMaxDistance2;
109 double m_dfZObserver{0};
113 std::array<double, 5> m_testAngle{};
114 double m_lowTanPitch{std::numeric_limits<double>::quiet_NaN()};
115 double m_highTanPitch{std::numeric_limits<double>::quiet_NaN()};
116 double (*oZcalc)(int, int, double, double, double){};
118 double calcHeightAdjFactor();
120 void setOutputNormal(Lines &lines,
int pos,
double dfZ);
121 void setOutputSd(Lines &lines,
int pos,
double dfZ);
123 bool readLine(
int nLine, Lines &lines);
124 bool writeLine(
int nLine, std::vector<double> &vResult);
125 bool processLine(
int nLine, Lines &lines);
126 bool processFirstLine(Lines &lines);
127 void processFirstLineLeft(
const LineLimits &ll, Lines &lines,
bool sdCalc);
128 void processFirstLineRight(
const LineLimits &ll, Lines &lines,
bool sdCalc);
129 void processFirstLineTopOrBottom(
const LineLimits &ll, Lines &lines);
130 void processLineLeft(
int nYOffset, LineLimits &ll, Lines &lines,
132 void processLineRight(
int nYOffset, LineLimits &ll, Lines &lines,
134 LineLimits adjustHeight(
int iLine, Lines &lines);
135 bool maskInitial(std::vector<double> &vResult,
const LineLimits &ll,
137 bool maskAngleLeft(std::vector<double> &vResult,
int nLine);
138 bool maskAngleRight(std::vector<double> &vResult,
int nLine);
139 void maskLineLeft(std::vector<double> &vResult,
const LineLimits &ll,
141 void maskLineRight(std::vector<double> &vResult,
const LineLimits &ll,
143 void calcPitchMask(
double dfZ,
double dfDist,
double dfResult,
145 void applyPitchMask(std::vector<double> &vResult,
146 const std::vector<double> &vPitchMaskVal);
147 void calcTestAngles();
149 inline bool sdMode()
const
Pool of worker threads.
Definition cpl_worker_thread_pool.h:64
A single raster band (or channel).
Definition gdal_rasterband.h:108
Support for progress reporting in viewshed construction.
Definition progress.h:23
Executes a viewshed computation on a source band, placing the result in the destination band.
Definition viewshed_executor.h:69
bool run()
Run the viewshed computation.
Definition viewshed_executor.cpp:1132
bool hasFoundNoData() const
Return whether an input pixel is at the nodata value.
Definition viewshed_executor.h:84
CPLErr
Error category / error level.
Definition cpl_error.h:45
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....
Container for lines necessary for processing.
Definition viewshed_executor.h:34
std::vector< double > prevTmp
Saved prev values when in SD mode.
Definition viewshed_executor.h:40
Lines()
Constructor.
Definition viewshed_executor.h:44
std::vector< double > sd
SD mask.
Definition viewshed_executor.h:41
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:50
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:118