MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTerrainViewShed Class Reference

Detailed Description

 Note: This class has been deprecated, and the functionality replaced.
       Please see the headers in 'MapLinkTerrainViewShed.h' and the
       'MapLink Pro Developer's Guide' for more information.
       The MapLink Terrain Viewer sample application has been updated
       to demonstrate the usage of the new viewshed classes.

This class handles viewshed analysis for a MapLink Terrain Database. It works out what an observer can see over a specified area from a 3d position.

The user must supply terrain height data using the setSourceData method, and the coordinates of the observer via the setEyeCoords method. The line of sight analysis is performed by the calculateLineOfSight method and the results are retrieved using the getResultData method.

Public Member Functions

 TSLTerrainViewShed ()
 
virtual ~TSLTerrainViewShed ()
 
void calculateLineOfSight (int rowOrigin, int columnOrigin, double eyePointHeight, bool eyePointAboveGround, double maxRangeMU, bool applyCurveOfEarth, bool accurate, int sameDirCount=20)
 
TSLTerrainViewShedDatagetResultData () const
 
double getMUBottomLeftX () const
 
double getMUBottomLeftY () const
 
double getMUTopRightX () const
 
double getMUTopRightY () const
 
void setSourceData (double *values, int numRows, int numColumns, double cellDistanceMUInX, double cellDistanceMUInY, double muBottomLeftX, double muBottomLeftY, double muTopRightX, double muTopRightY)
 
void setEyeCoords (double eyemuX, double eyemuY)
 

Static Public Attributes

static const double nullDataValue
 

Protected Attributes

TerrainViewShedCalculator * m_losCalculator
 

Constructor & Destructor Documentation

◆ TSLTerrainViewShed()

TSLTerrainViewShed::TSLTerrainViewShed ( )

◆ ~TSLTerrainViewShed()

virtual TSLTerrainViewShed::~TSLTerrainViewShed ( )
virtual

Member Function Documentation

◆ calculateLineOfSight()

void TSLTerrainViewShed::calculateLineOfSight ( int rowOrigin,
int columnOrigin,
double eyePointHeight,
bool eyePointAboveGround,
double maxRangeMU,
bool applyCurveOfEarth,
bool accurate,
int sameDirCount = 20 )

Performs the viewshed analysis. Before this method is called the user must use the setData method to pass terrain data in and setEyeCoords to specify the location of the observer.

Once the calculation has finished the user must use the getData method to retreive the results.

Note: For the purposes of line of sight calculation, any areas which contain null terrain data are considered to be at sea level.

rowOrigin, columnOrigin - the start cell in the terrain data to calculate data from. If these are set to -1 the observers position will be used to work out the values instead.

eyePointHeight - the height of the observer in metres

eyePointAboveGround - set to true if the observer is above ground

maxRangeMU - the range in map units of the terrain data to calculate view shed data for

applyCurveOfEarth- adjust for curvature of the earth

accurate - if true then a more accurate but slower algorithm is used and the user must use the TSLTerrainViewShedData's getAccurateLos method to get the data

sameDirCount - the number of cells to try in a direction to get an accurate line of sight value. If this is set higher than default the calculations will be more accurate but slower

◆ getMUBottomLeftX()

double TSLTerrainViewShed::getMUBottomLeftX ( ) const

Gets the bottom left X map coordinate that was set by the last call to set Data

◆ getMUBottomLeftY()

double TSLTerrainViewShed::getMUBottomLeftY ( ) const

Gets the bottom left Y map coordinate that was set by the last call to set Data

◆ getMUTopRightX()

double TSLTerrainViewShed::getMUTopRightX ( ) const

Gets the top right X map coordinate that was set by the last call to setData

◆ getMUTopRightY()

double TSLTerrainViewShed::getMUTopRightY ( ) const

Gets the top right Y map coordinate that was set by the last call to setData

◆ getResultData()

TSLTerrainViewShedData * TSLTerrainViewShed::getResultData ( ) const

Gets the results of the last calculateLineOfSight operation.

Returns a TSLTerrainViewShedData *. The user must call its destroy method when finished.

◆ setEyeCoords()

void TSLTerrainViewShed::setEyeCoords ( double eyemuX,
double eyemuY )

Specify the location of the observer in map units

◆ setSourceData()

void TSLTerrainViewShed::setSourceData ( double * values,
int numRows,
int numColumns,
double cellDistanceMUInX,
double cellDistanceMUInY,
double muBottomLeftX,
double muBottomLeftY,
double muTopRightX,
double muTopRightY )

Sets the data needed for calculateLineOfSight operations

values - Array of terrain height data, use TSLTerrainViewShed::nullDataValue for null values. numRows - The number of rows in the terrain data numColumns - The number of columns in the terrain data

cellDistanceMUInX, cellDistanceMUInY - the area that a terrain data cell covers in map units of the terrain data.

muBottomLeftX, muBottomLeftY, muTopRightX, muTopRightY - the coordinates that the terrain data is for in map units of the terrain data.

Member Data Documentation

◆ m_losCalculator

TerrainViewShedCalculator* TSLTerrainViewShed::m_losCalculator
protected

◆ nullDataValue

const double TSLTerrainViewShed::nullDataValue
static

Data Members for Class Attributes Reserved for future use