MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTerrainVSInputEarthCurvature Class Reference
Inheritance diagram for TSLTerrainVSInputEarthCurvature:

Detailed Description

An input object shim, which wraps another input object, and applies earth curvature corrections.

Corrections may be applied based on a visual, or radar line of sight. These corrections may be considered accurate within 40Km of the viewshed's center.

These calculations assume that the earth is spherical. The accuracy can be increased by calling the earthRadius() method. This should be supplied with the radius of the earth, for the required viewshed location.

The input data object must have a valid coordinate system for the correction to be applied, and must return height data in meters. If the source data does not use meters for the vertical units, the provided input object must perform the required conversion.

Using this object as part of a viewshed calculation will decrease the performance significantly. It is recommended that the resolution, and radius of the viewshed operation are limited in order to mitigate this effect.

When using this input object, combined with the TSLTerrainVSAlgorithmRFVS, a compositor such as TSLTerrainVSCompositorCumulativeVisibility should be used. This ensures that the percieved 'horizon' of the viewshed will be symmetrical, and that any marginal points are marked as visible.

Public Types

enum  LOSType { LOSTypeVisual , LOSTypeRadar }
 

Public Member Functions

 TSLTerrainVSInputEarthCurvature (TSLTerrainVSInput *input)
 
virtual bool getData (unsigned int x, unsigned int y, double &value, const TSLTerrainVSAlgorithm::Parameters &params)
 
virtual TSLMUExtent queryExtent () const
 
virtual unsigned int width () const
 
virtual unsigned int height () const
 
virtual const TSLCoordinateSystemcoordinateSystem ()
 
void earthRadius (double radius=6378137.0)
 
void losType (TSLTerrainVSInputEarthCurvature::LOSType losType=TSLTerrainVSInputEarthCurvature::LOSTypeVisual)
 
virtual bool offsetToLatLong (unsigned int x, unsigned int y, double &lat, double &lon)
 
virtual bool offsetToMU (unsigned int x, unsigned int y, double &muX, double &muY)
 
virtual bool MUToOffset (double muX, double muY, unsigned int &x, unsigned int &y)
 
virtual bool LatLongToOffset (double lat, double lon, unsigned int &x, unsigned int &y)
 
virtual double postDistanceX ()
 
virtual double postDistanceY ()
 
virtual bool valid (const TSLTerrainVSAlgorithm::Parameters &params) const
 
virtual void processFinished ()
 
double getEarthRadius () const
 
TSLTerrainVSInputEarthCurvature::LOSType getLosType () const
 
- Public Member Functions inherited from TSLTerrainVSInput
void inc ()
 
void dec ()
 

Additional Inherited Members

- Protected Member Functions inherited from TSLTerrainVSInput
 TSLTerrainVSInput (unsigned int width, unsigned int height, TSLMUExtent extent, TSLCoordinateSystem *coordinateSystem)
 
 TSLTerrainVSInput ()
 
 TSLTerrainVSInput (const TSLTerrainVSInput &other)
 
virtual ~TSLTerrainVSInput ()
 
- Protected Attributes inherited from TSLTerrainVSInput
unsigned int m_width
 
unsigned int m_height
 
TSLCoordinateSystemm_coordinateSystem
 
double m_postDistanceX
 
double m_postDistanceY
 
TSLMUExtent m_extent
 

Member Enumeration Documentation

◆ LOSType

Enumerator
LOSTypeVisual 
LOSTypeRadar 

Constructor & Destructor Documentation

◆ TSLTerrainVSInputEarthCurvature()

TSLTerrainVSInputEarthCurvature::TSLTerrainVSInputEarthCurvature ( TSLTerrainVSInput * input)

Constructor.

Parameters
inputThe input object to read data from. Each height value read from this object will be corrected for earth curvature.

Member Function Documentation

◆ coordinateSystem()

virtual const TSLCoordinateSystem * TSLTerrainVSInputEarthCurvature::coordinateSystem ( )
virtual

Query the coordinate system of the input data.

Reimplemented from TSLTerrainVSInput.

◆ earthRadius()

void TSLTerrainVSInputEarthCurvature::earthRadius ( double radius = 6378137.0)

Override the value used for the earth's radius. This value is in metres.

The calculations used by this object assume that the earth is spherical. The accuracy of these calculations can be increased by setting this valud to the radius of the earth, for the required viewshed location.

The default value is 6378137.0m.

◆ getData()

virtual bool TSLTerrainVSInputEarthCurvature::getData ( unsigned int x,
unsigned int y,
double & value,
const TSLTerrainVSAlgorithm::Parameters & params )
virtual

Query a height value from the input data.

If the valid() method has returned false, this method will never be called by the viewshed algorithm.

The location given to this method is specified as an offset, from the bottom-left of the data.

This method will read the height data from the input object, and adjust it for earth curvature. The adjustment is performed for either visual, or radar line of sight, depending on the value passed to the losType() method.

Parameters
xThe x offset to query
yThe y offset to query
valueStorage for the height value
paramsThe parameters of the viewshed operation

Implements TSLTerrainVSInput.

◆ getEarthRadius()

double TSLTerrainVSInputEarthCurvature::getEarthRadius ( ) const

Retrieve the value used for the earth's radius. This value is in metres.

◆ getLosType()

TSLTerrainVSInputEarthCurvature::LOSType TSLTerrainVSInputEarthCurvature::getLosType ( ) const

Retrieve the type of height correction to calculate.

◆ height()

virtual unsigned int TSLTerrainVSInputEarthCurvature::height ( ) const
virtual

Query the height of the input data

Reimplemented from TSLTerrainVSInput.

◆ LatLongToOffset()

virtual bool TSLTerrainVSInputEarthCurvature::LatLongToOffset ( double lat,
double lon,
unsigned int & x,
unsigned int & y )
virtual

Query the X/Y offset which corresponds to the provided Latitude/Longitude.

The base-class implementation of this method will call LatLongToMU on the input object's coordinate system.

Parameters
latThe latitude of the point to convert
lonThe logitude of the point to convert
xStorage for the returned x offset
yStorage for the returned y offset
Returns
true if the point was converted, or false if an error occurred. false will be returned if the calculated offset is outside the input objects extent.

Reimplemented from TSLTerrainVSInput.

◆ losType()

void TSLTerrainVSInputEarthCurvature::losType ( TSLTerrainVSInputEarthCurvature::LOSType losType = TSLTerrainVSInputEarthCurvature::LOSTypeVisual)

Set the type of height correction to calculate.

◆ MUToOffset()

virtual bool TSLTerrainVSInputEarthCurvature::MUToOffset ( double muX,
double muY,
unsigned int & x,
unsigned int & y )
virtual

Query the X/Y offset which corresponds to the provided map unit location

Parameters
muXThe MU X coordinate of the point to convert
muYThe MU Y coordinate of the point to convert
xStorage for the returned x offset
yStorage for the returned y offset
Returns
true if the point was converted, or false if an error occurred. false will be returned if the calculated offset is outside the input objects extent.

Reimplemented from TSLTerrainVSInput.

◆ offsetToLatLong()

virtual bool TSLTerrainVSInputEarthCurvature::offsetToLatLong ( unsigned int x,
unsigned int y,
double & lat,
double & lon )
virtual

Query the geographic location of the provided X/Y offset, in Latitude/Longitude.

The base-class implementation of this method will call MUToLatLong on the input object's coordinate system.

Parameters
xThe X coordinate of the point to convert
yThe Y coordinate of the point to convert
latStorage for the returned latitude
lonStorage for the returned longitude
Returns
true if the point was converted, or false if an error occurred.

Reimplemented from TSLTerrainVSInput.

◆ offsetToMU()

virtual bool TSLTerrainVSInputEarthCurvature::offsetToMU ( unsigned int x,
unsigned int y,
double & muX,
double & muY )
virtual

Query the geographic location of the provided X/Y offset, in map units.

Parameters
xThe X coordinate of the point to convert
yThe Y coordinate of the point to convert
muXStorage for the returned MU X value
muYStorage for the returned MU Y value

Reimplemented from TSLTerrainVSInput.

◆ postDistanceX()

virtual double TSLTerrainVSInputEarthCurvature::postDistanceX ( )
virtual

Query the horizontal post-distance of the input data.

This is the distance between sample points, in map units

Reimplemented from TSLTerrainVSInput.

◆ postDistanceY()

virtual double TSLTerrainVSInputEarthCurvature::postDistanceY ( )
virtual

Query the vertical post-distance of the input data.

This is the distance between sample points, in map units

Reimplemented from TSLTerrainVSInput.

◆ processFinished()

virtual void TSLTerrainVSInputEarthCurvature::processFinished ( )
virtual

This method will be called by the viewshed algorithm when the viewshed calculation has finished.

Implements TSLTerrainVSInput.

◆ queryExtent()

virtual TSLMUExtent TSLTerrainVSInputEarthCurvature::queryExtent ( ) const
virtual

Query the extent of the input data.

The units of this extent are defined by the source data, and this object's coordinate system.

Returns the input object's extent.

Reimplemented from TSLTerrainVSInput.

◆ valid()

virtual bool TSLTerrainVSInputEarthCurvature::valid ( const TSLTerrainVSAlgorithm::Parameters & params) const
virtual

This method will be called by the viewshed algorithm, to provide the input object with a mechanism for initialisation, and an opportunity to terminate the viewshed calculation if required.

The extent provided by params.m_viewShedMUExtent should not be considered valid during this call, as it will not have been fully calculated.

This call will be forwarded to the valid() call of the wrapped input object,

Parameters
paramsThe parameters of the viewshed operation.
Returns
true if the input object is valid, or false otherwise.

Implements TSLTerrainVSInput.

◆ width()

virtual unsigned int TSLTerrainVSInputEarthCurvature::width ( ) const
virtual

Query the width of the input data

Reimplemented from TSLTerrainVSInput.