Class TLcdAltitudeMatrixViewFactory
Creates ILcdAltitudeMatrixView
objects representing a shape discretization with an
altitude value for each discretized point.
-
Constructor Summary
ConstructorDescriptionConstructs a new altitude matrix view factory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aStatusListener) Starts notifying a listener with the progress of the visibility calculations.createAreaAltitudeMatrixView
(ILcdShape aShape, ILcdGeoReference aShapeReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified shape that can be used to compute a visibility.createAreaAltitudeMatrixView
(ILcdShape aShape, ILcdGeoReference aShapeReference, ILcdAltitudeProvider aAltitudeProvider, ILcdRaster aRaster, ILcdGeoReference aRasterReference, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified shape that can be used to compute a visibility.createInterpolatedPathAltitudeMatrixView
(ILcdPolyline aPolyline, ILcdGeoReference aPolylineReference, double aStepSize, TLcdLineType aLineType, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified polyline that can be used to compute a visibility.final ILcdAltitudeMatrixView
createPathAltitudeMatrixView
(ILcdCurve aCurve, ILcdGeoReference aCurveReference, double aStepSize, TLcdCoverageAltitudeMode aAltitudeMode, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified curve using the height values of the points of the curve.createPathAltitudeMatrixView
(ILcdCurve aCurve, ILcdGeoReference aCurveReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified curve that can be used to compute a visibility.createPathAltitudeMatrixView
(ILcdPolyline aPolyline, ILcdGeoReference aPolylineReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdLineType aLineType, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified polyline that can be used to compute a visibility.createPointAltitudeMatrixView
(ILcdPoint aPoint, ILcdGeoReference aPointReference, double aPointAltitude, TLcdCoverageAltitudeMode aPointAltitudeMode, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) Creates anILcdAltitudeMatrixView
for the specified point that can be used to compute a visibility.void
removeStatusListener
(ILcdStatusListener aStatusListener) Terminates notifying a listener of the progress of the visibility calculations.
-
Constructor Details
-
TLcdAltitudeMatrixViewFactory
public TLcdAltitudeMatrixViewFactory()Constructs a new altitude matrix view factory.
-
-
Method Details
-
addStatusListener
Starts notifying a listener with the progress of the visibility calculations.- Parameters:
aStatusListener
- will be notified of progress of the visibility calculations.- See Also:
-
removeStatusListener
Terminates notifying a listener of the progress of the visibility calculations.- Parameters:
aStatusListener
- will no longer be notified of progress of the visibility calculations.- See Also:
-
createPointAltitudeMatrixView
public ILcdAltitudeMatrixView createPointAltitudeMatrixView(ILcdPoint aPoint, ILcdGeoReference aPointReference, double aPointAltitude, TLcdCoverageAltitudeMode aPointAltitudeMode, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException Creates an
ILcdAltitudeMatrixView
for the specified point that can be used to compute a visibility. The method returns a 1x1 matrix containing the specified altitude value. If theABOVE_OBJECT
altitude mode is used, the specified altitude is transformed, using the points Z coordinate, to a value above ellipsoid. This value is then set as matrix value.The specified altitude mode also defines the altitude mode of the resulting matrix view. If the altitude mode
ABOVE_OBJECT
is used, the altitude mode of the resulting matrix will beABOVE_GEOID
.Note that, if the point cannot be transformed to the specified matrix view reference, an
TLcdOutOfBoundsException
will be thrown.- Parameters:
aPoint
- The point to create the matrix view for.aPointReference
- The reference in which the point is defined.aPointAltitude
- The altitude value for the given point.aPointAltitudeMode
- Indicates how the altitude should be interpreted.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new 1x1 matrix containing the specified altitude value.
- Throws:
TLcdOutOfBoundsException
- if the point transformation fails.
-
createPathAltitudeMatrixView
public ILcdAltitudeMatrixView createPathAltitudeMatrixView(ILcdPolyline aPolyline, ILcdGeoReference aPolylineReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdLineType aLineType, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException Creates an
ILcdAltitudeMatrixView
for the specified polyline that can be used to compute a visibility. The specified step size defines the distance (in meters) between consecutive generated points on the polyline. The method returns a 1xN matrix filled with values retrieved from the specified altitude provider. The altitude mode of the resulting matrix view is defined by the altitude mode of the specified altitude provider.This method will discretize the polyline in the polyline reference. Each discretized point is converted to the matrix view reference to be used as associated point coordinate. For each converted point, the altitude provider is called to find the altitude value needed to initialize the altitude matrix view. Note that, if a point transformation fails, the method throws an
TLcdOutOfBoundsException
.Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread can be interrupted before the matrix is created. In this case,null
shall be returned.The
line type
defines how a polyline needs to be discretized. Due to the fact that the discretization of the polyline is done in the polyline reference, the line type strongly depends on the reference of the polyline. The following combinations are supported:line reference line type ILcdGeodeticReference + GEODETIC ILcdGeodeticReference + RHUMBLINE ILcdGridReference + CARTESIAN IllegalArgumentException
will be thrown. Note that aNullPointerException
is thrown when the line type isnull
.The following image gives a visual explanation of this altitude matrix view. The gray dots are the polyline points, the green dots the generated points on the polyline. The matrix view will contain an altitude value for the green and gray dots.
- Parameters:
aPolyline
- The polyline to create the matrix view for.aPolylineReference
- The reference in which the polyline is defined.aAltitudeProvider
- The altitude provider for the given polyline.aStepSize
- The step size used while scanning the polyline.aLineType
- Indicates how to interpolate the polyline.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new 1xN matrix filled with values retrieved from the specified altitude provider.
- Throws:
IllegalArgumentException
- if the line type and the polyline reference do not match.NullPointerException
- if the line type isnull
.TLcdOutOfBoundsException
- if a point transformation fails.
-
createPathAltitudeMatrixView
public ILcdAltitudeMatrixView createPathAltitudeMatrixView(ILcdCurve aCurve, ILcdGeoReference aCurveReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException Creates an
ILcdAltitudeMatrixView
for the specified curve that can be used to compute a visibility. The specified step size defines the distance (in meters) between consecutive generated points on the curve. The method returns a 1xN matrix filled with values retrieved from the specified altitude provider. The altitude mode of the resulting matrix view is defined by the altitude mode of the specified altitude provider.This method will discretize the curve in the reference of the curve. Each discretized point is converted to the matrix view reference to be used as associated point coordinate. For each converted point, the altitude provider is called to find the altitude value needed to initialize the altitude matrix view. Note that, if a point transformation fails, the method throws an
TLcdOutOfBoundsException
.If the specified curve implements
ILcdCompositeCurve
, a composite altitude matrix view is created combining an altitude matrix view for each curve in the composite curve.Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread can be interrupted before the matrix is created. In this case,null
shall be returned.- Parameters:
aCurve
- The curve to create the matrix view for.aCurveReference
- The reference in which the curve is defined.aAltitudeProvider
- The altitude provider for the given curve.aStepSize
- The step size used while scanning the curve.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new 1xN matrix filled with values retrieved from the specified altitude provider.
- Throws:
TLcdOutOfBoundsException
- if a point transformation fails.
-
createPathAltitudeMatrixView
public final ILcdAltitudeMatrixView createPathAltitudeMatrixView(ILcdCurve aCurve, ILcdGeoReference aCurveReference, double aStepSize, TLcdCoverageAltitudeMode aAltitudeMode, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException Creates an
ILcdAltitudeMatrixView
for the specified curve using the height values of the points of the curve. This matrix view can be used to compute a visibility. The specified step size defines the distance (in meters) between consecutive generated points on the curve. The method returns a 1xN matrix filled with values retrieved where the height is retrieved from the curve. The altitude mode of the resulting matrix view is defined by the altitude mode of the specified altitude provider.This method will discretize the curve in the reference of the curve. Each discretized point is converted to the matrix view reference to be used as associated point coordinate. Note that, if a point transformation fails, the method throws an
TLcdOutOfBoundsException
.If the specified curve implements
ILcdCompositeCurve
, a composite altitude matrix view is created combining an altitude matrix view for each curve in the composite curve.Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread can be interrupted before the matrix is created. In this case,null
shall be returned.- Parameters:
aCurve
- The curve to create the matrix view for.aCurveReference
- The reference in which the curve is defined.aStepSize
- The step size used while scanning the curve.aAltitudeMode
- The altitude mode defining how the z-values of the curve points must be interpretedaAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new 1xN matrix filled with values retrieved from the specified altitude provider.
- Throws:
TLcdOutOfBoundsException
- if a point transformation fails.- Since:
- 2019.1
-
createInterpolatedPathAltitudeMatrixView
public ILcdAltitudeMatrixView createInterpolatedPathAltitudeMatrixView(ILcdPolyline aPolyline, ILcdGeoReference aPolylineReference, double aStepSize, TLcdLineType aLineType, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException Creates an
ILcdAltitudeMatrixView
for the specified polyline that can be used to compute a visibility. The specified step size defines the distance (in meters) between consecutive generated points on the polyline. The method returns a 1xN matrix filled with values along the interpolated path between the polyline points. The altitude mode of the resulting matrix view isTLcdCoverageAltitudeMode.ABOVE_GEOID
.This method will discretize the polyline in the polyline reference. Each discretized point is converted to the matrix view reference to be used as associated point coordinate. For each discretized point on the polyline segment defined by point A and point B, the altitude value is calculated as the interpolated value between the Z coordinates of point A and point B. The value is interpreted as above ellipsoid. This means that the Z-coordinates of the points are assumed to be defined as above ellipsoid. The altitude value is used to initialize the altitude matrix view. Note that, if a point transformation fails, the method throws an
TLcdOutOfBoundsException
.Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread can be interrupted before the matrix is created. In this case,null
shall be returned.The
line type
defines how a polyline needs to be discretized. Due to the fact that the discretization of the polyline is done in the polyline reference, the line type strongly depends on the reference of the polyline. The following combinations are supported:line reference line type ILcdGeodeticReference + GEODETIC ILcdGeodeticReference + RHUMBLINE ILcdGridReference + CARTESIAN IllegalArgumentException
will be thrown. Note that aNullPointerException
is thrown when the line type isnull
.The following image gives a visual explanation of this altitude matrix view. The gray dots are the polyline points, the green dots the generated points on the polyline. The matrix view will contain an altitude value for the green and gray dots.
- Parameters:
aPolyline
- The polyline to create the matrix view for.aPolylineReference
- The reference in which the polyline is defined.aStepSize
- The step size used while scanning the polyline.aLineType
- Indicates how to interpolate the polyline.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new 1xN matrix filled with values along the interpolated path between the polyline points.
- Throws:
IllegalArgumentException
- if the line type and the polyline reference do not match.NullPointerException
- if the line type isnull
.TLcdOutOfBoundsException
- if a point transformation fails.
-
createAreaAltitudeMatrixView
public ILcdAltitudeMatrixView createAreaAltitudeMatrixView(ILcdShape aShape, ILcdGeoReference aShapeReference, ILcdAltitudeProvider aAltitudeProvider, double aStepSize, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException, TLcdNoBoundsException Creates an
ILcdAltitudeMatrixView
for the specified shape that can be used to compute a visibility. The specified step size defines the distance (in meters) between consecutive generated points inside the shape bounds. The method returns a NxM matrix filled with values retrieved from the specified altitude provider. The altitude mode of the resulting matrix view is defined by the altitude mode of the specified altitude provider.This method will convert the shape bounds to the matrix view reference. If this fails, an
TLcdNoBoundsException
is thrown. The converted bounds are discretized in the matrix view reference. Each discretized point is used as associated point and is converted back to the shape reference to check if it is contained by the shape or not. If this transformation fails, anTLcdOutOfBoundsException
is thrown. For discretized points inside the shape, the altitude provider is called to find the altitude value needed to initialize the altitude matrix view. For points outside the shape, the matrix view altitude descriptor is used to find the special altitude value corresponding to the interpretationTLcdAltitudeInterpretation.OUTSIDE_SHAPE
.Note that, because a line shape (for example a polyline) does not have an area, there will not be enough discretization points to represent the line shape. Almost all points will lie outside the shape which makes the result in general useless. This method is therefor only usable for area shapes like polygons, arc bands, ...
Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread cannot be interrupted before the matrix is created.The following image gives a visual explanation of this altitude matrix view. The green dots represent pixels inside the shape, the red dots are pixels outside the shape. The altitude provider is responsible for setting special values for points outside the shape.
- Parameters:
aShape
- The shape to create the matrix view for.aShapeReference
- The reference in which the shape is defined.aAltitudeProvider
- The altitude provider for the given shape.aStepSize
- The step size used while scanning the shape.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new NxM matrix filled with values retrieved from the specified altitude provider.
- Throws:
TLcdOutOfBoundsException
- if a point transformation fails.TLcdNoBoundsException
- if the bounds transformation fails.
-
createAreaAltitudeMatrixView
public ILcdAltitudeMatrixView createAreaAltitudeMatrixView(ILcdShape aShape, ILcdGeoReference aShapeReference, ILcdAltitudeProvider aAltitudeProvider, ILcdRaster aRaster, ILcdGeoReference aRasterReference, TLcdAltitudeDescriptor aAltitudeMatrixViewDescriptor, ILcdGeoReference aAltitudeMatrixViewReference) throws TLcdOutOfBoundsException, TLcdNoBoundsException Creates an
ILcdAltitudeMatrixView
for the specified shape that can be used to compute a visibility. The method returns a NxM matrix filled with values retrieved from the specified altitude provider. The shape is discretized in a way that each pixel from the raster corresponds to a pixel in the matrix view. Each matrix pixel corresponds to the center of the raster pixel. The altitude mode of the resulting matrix view is defined by the altitude mode of the specified altitude provider.This method will convert the shape bounds to the matrix view reference. If this fails, an
TLcdNoBoundsException
is thrown. The converted bounds are discretized in the matrix view reference. Each discretized point is used as associated point and is converted back to the shape reference to check if it is contained by the shape or not. If this transformation fails, anTLcdOutOfBoundsException
is thrown. For discretized points inside the shape, the altitude provider is called to find the altitude value needed to initialize the altitude matrix view. For points outside the shape, the matrix view altitude descriptor is used to find the special altitude value corresponding to the interpretationTLcdAltitudeInterpretation.OUTSIDE_SHAPE
.Note that, because a line shape (for example a polyline) does not have an area, there will not be enough discretization points to represent the line shape. Almost all points will lie outside the shape which makes the result in general useless. This method is therefor only usable for area shapes like polygons, arc bands, ...
This implementation requires that both raster and matrix view references are equal. If not, an
IllegalArgumentException
will be thrown.Note that, when the current thread is interrupted, the method will return the intermediate result. Processed points are initialized with the altitude value from the altitude provider. The other points are set to the unknown altitude value, corresponding to the interpretation
UNKNOWN_ELEVATION
. The thread cannot be interrupted before the matrix is created.The following image gives a visual explanation of this altitude matrix view. The green dots represent pixels inside the shape, the red dots are pixels outside the shape. The altitude provider is responsible for setting special values for points outside the shape.
- Parameters:
aShape
- The shape to create the matrix view for.aShapeReference
- The reference in which the shape is defined.aAltitudeProvider
- The altitude provider for the given shape.aRaster
- The raster used to discretize the shape.aRasterReference
- The reference in which the raster is defined.aAltitudeMatrixViewDescriptor
- Indicating to which special values the altitude interpretations should be mapped and vice versa.aAltitudeMatrixViewReference
- The reference in which the associated points of the created matrix view are defined.- Returns:
- a new NxM matrix filled with values retrieved from the specified altitude provider.
- Throws:
IllegalArgumentException
- if the given raster and matrix view references are not equal.TLcdOutOfBoundsException
- if a point transformation fails.TLcdNoBoundsException
- if the bounds transformation fails.
-