![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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 ¶ms) |
virtual TSLMUExtent | queryExtent () const |
virtual unsigned int | width () const |
virtual unsigned int | height () const |
virtual const TSLCoordinateSystem * | coordinateSystem () |
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 ¶ms) const |
virtual void | processFinished () |
double | getEarthRadius () const |
TSLTerrainVSInputEarthCurvature::LOSType | getLosType () const |
![]() | |
void | inc () |
void | dec () |
Additional Inherited Members | |
![]() | |
TSLTerrainVSInput (unsigned int width, unsigned int height, TSLMUExtent extent, TSLCoordinateSystem *coordinateSystem) | |
TSLTerrainVSInput () | |
TSLTerrainVSInput (const TSLTerrainVSInput &other) | |
virtual | ~TSLTerrainVSInput () |
![]() | |
unsigned int | m_width |
unsigned int | m_height |
TSLCoordinateSystem * | m_coordinateSystem |
double | m_postDistanceX |
double | m_postDistanceY |
TSLMUExtent | m_extent |
TSLTerrainVSInputEarthCurvature::TSLTerrainVSInputEarthCurvature | ( | TSLTerrainVSInput * | input | ) |
Constructor.
input | The input object to read data from. Each height value read from this object will be corrected for earth curvature. |
|
virtual |
Query the coordinate system of the input data.
Reimplemented from TSLTerrainVSInput.
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.
|
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.
x | The x offset to query |
y | The y offset to query |
value | Storage for the height value |
params | The parameters of the viewshed operation |
Implements TSLTerrainVSInput.
double TSLTerrainVSInputEarthCurvature::getEarthRadius | ( | ) | const |
Retrieve the value used for the earth's radius. This value is in metres.
TSLTerrainVSInputEarthCurvature::LOSType TSLTerrainVSInputEarthCurvature::getLosType | ( | ) | const |
Retrieve the type of height correction to calculate.
|
virtual |
Query the height of the input data
Reimplemented from TSLTerrainVSInput.
|
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.
lat | The latitude of the point to convert |
lon | The logitude of the point to convert |
x | Storage for the returned x offset |
y | Storage for the returned y offset |
Reimplemented from TSLTerrainVSInput.
void TSLTerrainVSInputEarthCurvature::losType | ( | TSLTerrainVSInputEarthCurvature::LOSType | losType = TSLTerrainVSInputEarthCurvature::LOSTypeVisual | ) |
Set the type of height correction to calculate.
|
virtual |
Query the X/Y offset which corresponds to the provided map unit location
muX | The MU X coordinate of the point to convert |
muY | The MU Y coordinate of the point to convert |
x | Storage for the returned x offset |
y | Storage for the returned y offset |
Reimplemented from TSLTerrainVSInput.
|
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.
x | The X coordinate of the point to convert |
y | The Y coordinate of the point to convert |
lat | Storage for the returned latitude |
lon | Storage for the returned longitude |
Reimplemented from TSLTerrainVSInput.
|
virtual |
Query the geographic location of the provided X/Y offset, in map units.
x | The X coordinate of the point to convert |
y | The Y coordinate of the point to convert |
muX | Storage for the returned MU X value |
muY | Storage for the returned MU Y value |
Reimplemented from TSLTerrainVSInput.
|
virtual |
Query the horizontal post-distance of the input data.
This is the distance between sample points, in map units
Reimplemented from TSLTerrainVSInput.
|
virtual |
Query the vertical post-distance of the input data.
This is the distance between sample points, in map units
Reimplemented from TSLTerrainVSInput.
|
virtual |
This method will be called by the viewshed algorithm when the viewshed calculation has finished.
Implements TSLTerrainVSInput.
|
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.
|
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,
params | The parameters of the viewshed operation. |
Implements TSLTerrainVSInput.
|
virtual |
Query the width of the input data
Reimplemented from TSLTerrainVSInput.