public final class TerrainAzimuthElevationMask extends Object
TerrainProvider
.AzimuthElevationMask
Modifier and Type  Method and Description 

static AzimuthElevationMask 
compute(TerrainProvider provider,
Cartographic observerPosition,
int numberOfAzimuthSteps,
double stepSize,
double maximumSearchAngle)
Computes an azimuthelevation mask from the specified terrain provider.

static AzimuthElevationMask 
compute(TerrainProvider provider,
Cartographic observerPosition,
int numberOfAzimuthSteps,
double stepSize,
double maximumSearchAngle,
ITrackCalculationProgress tracker)
Computes an azimuthelevation mask from the specified terrain provider with progress tracking.

static DelayedTerrainAzimuthElevationMask 
createDelayedMask(TerrainProvider provider,
Cartographic observerPosition,
int numberOfAzimuthSteps,
double stepSize,
double maximumSearchAngle)
Creates an azimuthelevation mask which can compute its values dynamically from the specified terrain provider.

public static DelayedTerrainAzimuthElevationMask createDelayedMask(TerrainProvider provider, @Nonnull Cartographic observerPosition, int numberOfAzimuthSteps, double stepSize, double maximumSearchAngle)
This method works by casting a ray out from the observerPosition
in a number of directions to
determine the minimum elevation angle that is visible above the terrain in that direction. More specifically,
the various distances at which the minimum elevation angle increases in that direction are determined.
Selecting values for numberOfAzimuthSteps
, stepSize
, and
maximumSearchAngle
requires making a tradeoff between the accuracy of the result and the time
to compute it. The ideal values to use depend on the specifics of the problem being solved and the
nature of the terrain data employed.
numberOfAzimuthSteps
is the number of rays to cast out from the observerPosition
in computing the mask. A value of 360 casts a ray for each degree, and is a reasonable value to use. Notice that
when a value of 360 is used, the count of elevation masks will be 361 because it contains the elevation for both
0 and 360. The elevation data for 360 copies data from 0 with the exception of the azimuth for efficiency.
stepSize
is the distance between steps along the ray, in radians. A reasonable value for this
parameter would sample approximately three times per terrain grid cell, or 1/3 of the smallest of
DeltaLongitude
(get
/ set
) and DeltaLatitude
(get
/ set
).
maximumSearchAngle
is the maximum angle, in radians, to move along each ray. In other words,
this parameter indicates the stopping point for sampling along the ray. A reasonable value will take into account
the difference between the maximum and minimum heights of terrain provided by provider
and
potentially how close together the minimum and maximum heights are located.
The following example shows one way this value might be chosen:
double approxHeightOfMtEverest = 8850.0;
double semimajorAxisLength = WorldGeodeticSystem1984.getShape().getSemimajorAxisLength();
double maximumSearchAngle = Math.acos(semimajorAxisLength / (semimajorAxisLength + approxHeightOfMtEverest));
provider
 The source of terrain from which to compute the mask.observerPosition
 The planetodetic position of the stationary observer around which the mask is computed.numberOfAzimuthSteps
 The number of azimuth steps to use to compute the mask.
This will define the resolution of the mask around the horizon.stepSize
 The size of the step along each azimuth ray, in radians.maximumSearchAngle
 The maximum angle, in radians, to move along each azimuth ray in constructing the mask.ArgumentOutOfRangeException
 Thrown if numberOfAzimuthSteps
is less than or equal to zero.public static AzimuthElevationMask compute(@Nonnull TerrainProvider provider, @Nonnull Cartographic observerPosition, int numberOfAzimuthSteps, double stepSize, double maximumSearchAngle, @Nullable ITrackCalculationProgress tracker)
This method works by casting a ray out from the observerPosition
in a number of directions to
determine the minimum elevation angle that is visible above the terrain in that direction. More specifically,
the various distances at which the minimum elevation angle increases in that direction are determined.
Selecting values for numberOfAzimuthSteps
, stepSize
, and
maximumSearchAngle
requires making a tradeoff between the accuracy of the result and the time
to compute it. The ideal values to use depend on the specifics of the problem being solved and the
nature of the terrain data employed.
numberOfAzimuthSteps
is the number of rays to cast out from the observerPosition
in computing the mask. A value of 360 casts a ray for each degree, and is a reasonable value to use. Notice that
when a value of 360 is used, the count of elevation masks will be 361 because it contains the elevation for both
0 and 360. The elevation data for 360 copies data from 0 with the exception of the azimuth for efficiency.
stepSize
is the distance between steps along the ray, in radians. A reasonable value for this
parameter would sample approximately three times per terrain grid cell, or 1/3 of the smallest of
DeltaLongitude
(get
/ set
) and DeltaLatitude
(get
/ set
).
maximumSearchAngle
is the maximum angle, in radians, to move along each ray. In other words,
this parameter indicates the stopping point for sampling along the ray. A reasonable value will take into account
the difference between the maximum and minimum heights of terrain provided by provider
and
potentially how close together the minimum and maximum heights are located.
The following example shows one way this value might be chosen:
double approxHeightOfMtEverest = 8850.0;
double semimajorAxisLength = WorldGeodeticSystem1984.getShape().getSemimajorAxisLength();
double maximumSearchAngle = Math.acos(semimajorAxisLength / (semimajorAxisLength + approxHeightOfMtEverest));
provider
 The source of terrain from which to compute the mask.observerPosition
 The planetodetic position of the stationary observer around which the mask is computed.numberOfAzimuthSteps
 The number of azimuth steps to use to compute the mask.stepSize
 The size of the step along each azimuth ray, in radians.maximumSearchAngle
 The maximum angle, in radians, to move along each azimuth ray in constructing the mask.tracker
 The object to which progress is reported and that is able to cancel this operation before it is complete, or null
.
When reporting progress, the 'additionalInformation' parameter to ITrackCalculationProgress.reportProgress(int, java.lang.Object)
will be null
.ArgumentNullException
 Thrown if provider
is null
.ArgumentOutOfRangeException
 Thrown if numberOfAzimuthSteps
is less than or equal to zero.public static AzimuthElevationMask compute(@Nonnull TerrainProvider provider, @Nonnull Cartographic observerPosition, int numberOfAzimuthSteps, double stepSize, double maximumSearchAngle)
This method works by casting a ray out from the observerPosition
in a number of directions to
determine the minimum elevation angle that is visible above the terrain in that direction. More specifically,
the various distances at which the minimum elevation angle increases in that direction are determined.
Selecting values for numberOfAzimuthSteps
, stepSize
, and
maximumSearchAngle
requires making a tradeoff between the accuracy of the result and the time
to compute it. The ideal values to use depend on the specifics of the problem being solved and the
nature of the terrain data employed.
numberOfAzimuthSteps
is the number of rays to cast out from the observerPosition
in computing the mask. A value of 360 casts a ray for each degree, and is a reasonable value to use. Notice that
when a value of 360 is used, the count of elevation masks will be 361 because it contains the elevation for both
0 and 360. The elevation data for 360 copies data from 0 with the exception of the azimuth for efficiency.
stepSize
is the distance between steps along the ray, in radians. A reasonable value for this
parameter would sample approximately three times per terrain grid cell, or 1/3 of the smallest of
DeltaLongitude
(get
/ set
) and DeltaLatitude
(get
/ set
).
maximumSearchAngle
is the maximum angle, in radians, to move along each ray. In other words,
this parameter indicates the stopping point for sampling along the ray. A reasonable value will take into account
the difference between the maximum and minimum heights of terrain provided by provider
and
potentially how close together the minimum and maximum heights are located.
The following example shows one way this value might be chosen:
double approxHeightOfMtEverest = 8850.0;
double semimajorAxisLength = WorldGeodeticSystem1984.getShape().getSemimajorAxisLength();
double maximumSearchAngle = Math.acos(semimajorAxisLength / (semimajorAxisLength + approxHeightOfMtEverest));
provider
 The source of terrain from which to compute the mask.observerPosition
 The planetodetic position of the stationary observer around which the mask is computed.numberOfAzimuthSteps
 The number of azimuth steps to use to compute the mask.stepSize
 The size of the step along each azimuth ray, in radians.maximumSearchAngle
 The maximum angle, in radians, to move along each azimuth ray in constructing the mask.ArgumentNullException
 Thrown if provider
is null
.ArgumentOutOfRangeException
 Thrown if numberOfAzimuthSteps
is less than or equal to zero.