Abstract class that represents viewshed calculation from this class specific implementations ( Viewshed and InverseViewshed) are derived. Class provides all the base functions for those algorithms, including implementation of plane sweep algorithm for viewshed according to Van Kreveld(1996) and Haverkort et al(2007), as implemented in GRASS GIS described by Toma et al. (2022).
More...
|
|
void | initEventList () |
| | Create event list for line sweep algorithm from input raster.
|
|
void | sortEventList () |
| | Sort event list for parsing.
|
| void | parseEventList (std::function< void(int, int)> progressCallback=[](int, int) {}) |
| | Parse event list by individual events.
|
| bool | extractValuesFromEventList (std::shared_ptr< ProjectedSquareCellRaster > dem_, std::string fileName, std::function< double(LoSNode)> func) |
| | Extract values from event list into a raster and save it to file.
|
| bool | isInsideAngles (const double &eventEnterAngle, const double &eventExitAngle) |
| | Checks if cell with these enter and exit angles falls inside the angle limit.
|
| void | setMaximalDistance (double distance) |
| | Set the Maximal Distance limit value. Limits event list creation to cells within this distance limit. Value is in the same units as CRS of input raster.
|
| void | setAngles (double minAngle, double maxAngle) |
| | Set horizontal angle limits for viewshed calculation. 0.
|
| void | setMaxConcurentTasks (int maxTasks) |
| | Set the number of maximum Concurent Taks that can be prepared in thread pool for processing.
|
| void | setMaxThreads (int threads) |
| | Set the maximal number of threads that can be used for calculation.
|
|
void | prepareMemoryRasters () |
| | Initialized output rasters in memory.
|
| virtual void | calculate (std::function< void(std::string, double)> stepsTimingCallback=[](std::string text, double time) {}, std::function< void(int, int)> progressCallback=[](int, int) {})=0 |
| | Calculate the viewshed. Covers all the steps - create list of events, sort list of events, parse list of events.
|
| virtual void | addEventsFromCell (int &row, int &column, const double &pixelValue, bool &solveCell)=0 |
| | Function that creates events for event list from given cell.
|
| virtual void | submitToThreadpool (const CellEvent &e)=0 |
| | Submit LoS with this CellEvent to threadpool for solving.
|
| std::shared_ptr< SingleBandRaster > | resultRaster (int index=0) |
| | Extract individual result raster.
|
| bool | saveResults (std::string location, std::string fileNamePrefix="") |
| | Save all result rasters into the folder, optionally using name prefix.
|
| LoSNode | statusNodeFromPoint (OGRPoint point) |
| | Create LoSNode from OGRPoint.
|
| OGRPoint | point (int row, int col) |
| | Create OGRPoint with coordinates of given row and column in the raster.
|
| void | setDefaultResultDataType (GDALDataType dataType) |
| | Set the Default Result Data Type to use in output rasters.
|
| long | numberOfValidCells () |
| | Number of valid cells in raster - cells not containing no data.
|
| long | numberOfCellEvents () |
| | Number of events in event list.
|
| bool | isValid () |
| | Check if the viewshed is valid, meaning that the important point is valid.
|
| bool | hasError () |
| | Check if an error occurred during calculation (e.g. in one of the worker threads).
|
| std::string | errorMessage () |
| | Message of the first error that occurred during calculation, empty string if there was none.
|
| void | setVisibilityMask (std::shared_ptr< ProjectedSquareCellRaster > mask) |
| | Set the Visibility Mask for viewshed calculation.
|
| long long | totalCountOfLoSNodes () |
| | Overall number of solved LoSNodes in all evaluated LoS.
|
| long long | sizeOfEvents () |
| | Size of cell event list in bytes.
|
| long long | totalSizeOfLoS () |
| | Overall size of all solved LoS in bytes.
|
| long long | meanSizeOfLoS () |
| | Mean size of solved LoS in bytes.
|
| double | initLastedSeconds () |
| | Number of seconds the creation of event list lasted.
|
| double | sortLastedSeconds () |
| | Number of seconds the sort of event list lasted.
|
| double | parseLastedSeconds () |
| | Number of seconds the parsing of event list lasted.
|
| double | processingLastedSeconds () |
| | Number of seconds the calculation of viewshed indexes lasted.
|
| long long | sizeOfOutputRaster () |
| | Size in bytes that one output raster takes.
|
| int | numberOfResultRasters () |
| | Number of output rasters. Equals number of input algorithms.
|
| long long | sizeOfOutputRasters () |
| | Size in bytes that all output raster takes.
|
| CellEvent | cellEvent (size_t i) |
| | Extract individual cell event from cell events.
|
| virtual void | calculateVisibilityRaster ()=0 |
| | Calculate visibility mask of areas which are visible from point (visibility), or from which the points is visible (inverse visibility). The visibility raster is calculated using fast algorithm, significantly faster than algorithms with visibility indices.
|
| bool | saveVisibilityRaster (std::string filePath) |
| | Save visibility raster to file.
|
|
void | calculateVisibilityMask () |
| | Calculate visibility mask raster.
|
|
|
std::vector< LoSNode > | mLosNodes |
| | LoSNodes in currently solved LoS while parsing event list.
|
|
std::vector< CellEvent > | mCellEvents |
| | Event list. All cell events for the input raster.
|
|
std::shared_ptr< ProjectedSquareCellRaster > | mInputDsm |
| | Input raster with digital surface model.
|
|
std::shared_ptr< ProjectedSquareCellRaster > | mVisibilityMask = nullptr |
| | Input raster with visibility calculation mask.
|
|
std::shared_ptr< Point > | mPoint |
| | Important point for visibility calculation. Either viewpoint (normal viewshed) or target point (inverse viewshed).
|
|
std::shared_ptr< ViewshedAlgorithms > | mVisibilityIndices |
| | Visibility indexes to calculate while calculating this viewshed. As AbstractViewshedAlgorithm.
|
|
GDALDataType | mDataType = OUTPUT_RASTER_DATA_TYPE |
| | Data type of output rasters.
|
|
int | mDefaultBand = 1 |
| | Default band to read from rasters.
|
|
long | mValidCells = 0 |
|
long | mTotalLosNodesCount = 0 |
|
long | mNumberOfLos = 0 |
|
bool | mInverseViewshed = false |
|
double | mMaxDistance = std::numeric_limits<double>::max() |
|
double | mMinAngle = std::numeric_limits<double>::quiet_NaN() |
|
double | mMaxAngle = std::numeric_limits<double>::quiet_NaN() |
|
int | mMaxNumberOfTasks = 100 |
| | Maximal number of LoS to solve, that can be stored in threadpool.
|
|
double | mCellSize = 0 |
|
bool | mValid = false |
|
std::mutex | mTaskErrorMutex |
| | Guards access to mTaskError, which can be written from worker threads.
|
|
std::string | mTaskError |
| | First error that occurred during calculation, empty if there was none.
|
|
bool | mCurvatureCorrections = false |
|
double | mEarthDiameter = EARTH_DIAMETER |
|
double | mRefractionCoefficient = REFRACTION_COEFFICIENT |
|
LoSNode | mLosNodePoint |
|
BS::thread_pool | mThreadPool |
| | Threadpool that takes care of preparing individual threads with LoS to be solved.
|
|
std::shared_ptr< ResultRasters > | mResults = std::make_shared<ResultRasters>() |
|
std::shared_ptr< ProjectedSquareCellRaster > | mVisibilityRaster = nullptr |
|
std::chrono::nanoseconds | mTimeInit |
|
std::chrono::nanoseconds | mTimeSort |
|
std::chrono::nanoseconds | mTimeParse |
|
double | mCellElevs [3] |
|
double | mAngleCenter |
|
double | mAngleEnter |
|
double | mAngleExit |
|
double | mEventDistance |
|
CellEvent | mEventCenter |
|
CellEvent | mEventEnter |
|
CellEvent | mEventExit = CellEvent() |
|
CellEvent | mEventEnterOpposite |
|
CellEvent | mEventExitOpposite = CellEvent() |
|
double | mOppositeAngleEnter |
|
double | mOppositeAngleExit |
|
LoSNode | mLoSNodeTemp = LoSNode() |
Abstract class that represents viewshed calculation from this class specific implementations ( Viewshed and InverseViewshed) are derived. Class provides all the base functions for those algorithms, including implementation of plane sweep algorithm for viewshed according to Van Kreveld(1996) and Haverkort et al(2007), as implemented in GRASS GIS described by Toma et al. (2022).
VAN KREVELD, M. Variations on Sweep Algorithms: efficient computation of extended viewsheds and class intervals. Utrecht: Utrecht University: Information and Computing Sciences, 1996.
HAVERKORT, H., TOMA, L., ZHUANG, Y. Computing Visibility on Terrains in External Memory. ACM Journal on Experimental Algorithmics, 13, 2009.
TOMA, L., ZHUANG, Y., RICHARD, W., METZ, M. Grass gis manual: r.viewshed, 2022. https://grass.osgeo.org/grass82/manuals/r.viewshed.html.