Class TLcdLOSCoverageFactory
A TLcdLOSCoverageFactory
is a factory which creates ILcdLOSCoverageMatrix
objects
representing the result of a line-of-sight computation around a point. These computations are based on
propagation functions describing the visibility along an azimuth. The resulting matrices can then be
converted into a raster or a list of polygons.
For example, to create a line-of-sight raster:
- Choose or create a propagation function (
ILcdLOSPropagationFunction
) describing how the detection wave propagates (visual, radar). - Create a circular area to compute the line-of-sight for. An
ILcdLOSCoverage
describes both the outline of the area and the sampling inside the area. - Call
createLOSCoverageMatrix
to compute the line-of-sight according to the propagation function on the covered area. The result is returned as anILcdLOSCoverageMatrix
in the specified reference. - Convert the matrix into a raster, using
createLOSCoverageRaster
. This raster can be used to display the result of the line-of-sight computations in a view using aILcdRasterPainter
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aStatusListener) Starts notifying a listener with the progress of line-of-sight computations and result conversions.createLOSCoverageContours
(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdGeoReference aTargetReference, double[] aContourLevels) Deprecated.createLOSCoverageContours
(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdGeoReference aTargetReference, TLcdComplexPolygonContourFinder.IntervalMode aIntervalMode, double[] aContourIntervalLevels, double[] aContourSpecialValues) Generates complex polygon contours from the givenILcdLOSCoverageMatrix
using the target reference and the contour levels.createLOSCoverageMatrix
(ILcdLOSPropagationFunction aLOSPropagationFunction, ILcdLOSCoverage aLOSCoverage, ILcdGeoReference aTargetReference) Creates aILcdLOSCoverageMatrix
representing the result of line-of-sight computations on the given areaaLOSCoverage
using the propagation functionaLOSPropagationFunction
.createLOSCoverageRaster
(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdMatrixRasterValueMapper aMatrixRasterValueMapper, ILcdGeoReference aTargetReference, double aTargetPixelDensity, TLcdCoverageFillMode aFillMode) Creates anILcdRaster
from theILcdLOSCoverageMatrix
using the given target reference, pixel density and fill mode.void
removeStatusListener
(ILcdStatusListener aStatusListener) Terminates notifying a listener of the progress of line-of-sight computations and result conversions.
-
Constructor Details
-
Method Details
-
removeStatusListener
Terminates notifying a listener of the progress of line-of-sight computations and result conversions.- Parameters:
aStatusListener
- will no longer be notified of progress when running a line-of-sight computation or when converting a coverage matrix to either a raster or a set of polygon contours.- See Also:
-
addStatusListener
Starts notifying a listener with the progress of line-of-sight computations and result conversions.- Parameters:
aStatusListener
- will be notified of progress when running a line-of-sight computation and when converting a coverage matrix to either a raster or a set of polygon contours.- See Also:
-
createLOSCoverageMatrix
public ILcdLOSCoverageMatrix createLOSCoverageMatrix(ILcdLOSPropagationFunction aLOSPropagationFunction, ILcdLOSCoverage aLOSCoverage, ILcdGeoReference aTargetReference) Creates a
ILcdLOSCoverageMatrix
representing the result of line-of-sight computations on the given areaaLOSCoverage
using the propagation functionaLOSPropagationFunction
.The target reference
aTargetReference
defines the reference in which the coverage matrix will be defined. Currently, only geodetic target references are supported.The coverage matrix contains coordinates that should be interpreted in the target reference. The points in the matrix cover the area of the line-of-sight coverage passed with intermediate steps as in the line-of-sight coverage.
Note that, when the current thread is interrupted,
null
is returned.- Parameters:
aLOSPropagationFunction
- The propagation function to use for the computation.aLOSCoverage
- The covered area and the intermediate step sizes.aTargetReference
- The reference in which the result will be defined.- Returns:
- a
ILcdLOSCoverageMatrix
representing the result of line-of-sight computations on the given area using the given propagation function. - Throws:
NullPointerException
- when anull
argument is found or when the propagation function was not set.IllegalArgumentException
- if the propagation function does not accept the parameteraLOSCoverage
or when the target reference is not a geodetic reference.
-
createLOSCoverageRaster
public ILcdRaster createLOSCoverageRaster(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdMatrixRasterValueMapper aMatrixRasterValueMapper, ILcdGeoReference aTargetReference, double aTargetPixelDensity, TLcdCoverageFillMode aFillMode) Creates an
ILcdRaster
from theILcdLOSCoverageMatrix
using the given target reference, pixel density and fill mode. TheaTargetReference
defines the reference in which the raster will be defined. Using the pixel density and the fill mode, the given line-of-sight coverage matrix is re-sampled into a rectangular coverage.The target pixel density is the pixel density of the resulting raster. This is the average number of pixels in an area of 1 by 1 in model coordinates. Higher densities will lead to more detailed coverages of the area. Note that the result is bound by the density of the samples taken of the underlying terrain data (which depends on the radial and angular step sizes used in the line-of-sight coverage to create the coverage matrix). The size occupied in memory by the coverage will increase linearly with this density.
The fill mode
aFillMode
indicates how the raster should be filled. Possible choices are:- maximum: the pixel value corresponds to the maximum value found in line-of-sight coverage matrix for that pixel.
- minimum: the pixel value corresponds to the minimum value found in line-of-sight coverage matrix for that pixel.
- nearest neighbor: the pixel value corresponds to the value computed nearest to the bottom left of the pixel location. This mode will ensure that the raster contains no holes.
The fill mode is combined with the given
ILcdMatrixRasterValueMapper
to map the matrix entry values onto raster pixel values. There are two possibilities. The first maps a matrix value to a raster value. This forward mapping is used with the minimum and the maximum fill mode. The methodILcdMatrixRasterValueMapper.mapMatrixValue
will be used to retrieve the raster value. The second maps a raster pixel to a number of matrix entries and combines the corresponding matrix values to a raster value, ensuring that all raster pixels are filled with a value. This backwards mapping is used with the nearest neighbor fill mode. The interface methodILcdMatrixRasterValueMapper.combineMatrixValues
is used with only one matrix value which corresponds to the matrix value of the point nearest to the raster pixel and only one weight value, which is1
.Note that, when the current thread is interrupted,
null
is returned.- Parameters:
aLOSCoverageMatrix
- The matrix to convert.aMatrixRasterValueMapper
- Mapper to map matrix values on raster values.aTargetReference
- The target reference in which the result will be defined.aTargetPixelDensity
- The pixel density of the resulting raster.aFillMode
- The fill mode indicating how the raster should be filled.- Returns:
- a raster representation of the given coverage matrix.
- Throws:
NullPointerException
- when one of the arguments (aLOSCoverageMatrix
,aMatrixRasterValueMapper
,aTargetReference
oraFillMode
) isnull
.IllegalArgumentException
- when aTargetReference is ageocentric reference
.
-
createLOSCoverageContours
public ILcdValuedPolygon[] createLOSCoverageContours(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdGeoReference aTargetReference, double[] aContourLevels) Deprecated.UsecreateLOSCoverageContours(ILcdLOSCoverageMatrix, com.luciad.reference.ILcdGeoReference, com.luciad.contour.TLcdComplexPolygonContourFinder.IntervalMode, double[], double[])
instead. This method relies on deprecated contour finding algorithms. The output of the new contour finding algorithms are much more practical to work with as they define complex polygons within an interval range, instead of simple polygons that represent contour edges. This method has been kept for compatibility reasons with LuciadMapGenerates contour lines from the given
ILcdLOSCoverageMatrix
using the target reference and the contour levels. The contours are returned as a set ofILcdValuedPolygon
objects. The target reference defines the reference in which the polygons will be defined.The contour levels define the different heights on which the contours will be calculated. They should be ordered from low to high.
The edge of a polygon indicates a contour line of equal height. The orientation of the returned polygons should be interpreted as follows:
- CLOCKWISE: The area on just on the exterior of the polygon has a higher value than the interior.
- COUNTER-CLOCKWISE: The area just on the exterior of the polygon has a lower value than the interior.
Note that, when the current thread is interrupted,
null
is returned.- Parameters:
aLOSCoverageMatrix
- The matrix to convert.aTargetReference
- The target reference in which the polygons are defined.aContourLevels
- The different levels to compute the contours on.- Returns:
- a contour representation of the given coverage matrix.
- Throws:
NullPointerException
- when anull
argument is found.
-
createLOSCoverageContours
public ILcdBounded[] createLOSCoverageContours(ILcdLOSCoverageMatrix aLOSCoverageMatrix, ILcdGeoReference aTargetReference, TLcdComplexPolygonContourFinder.IntervalMode aIntervalMode, double[] aContourIntervalLevels, double[] aContourSpecialValues) Generates complex polygon contours from the given
ILcdLOSCoverageMatrix
using the target reference and the contour levels. The contours are returned as a set ofTLcdIntervalContour
andTLcdValuedContour
objects, which are stored in an array ofILcdBounded
, and which have aILcdComplexPolygon
as base shape. TLcdIntervalContour are used when the complex polygon defines an area between an interval of two values, that is when two numerical parameters are needed to describe the area, TLcdValuedContour are used when the complex polygon defines a special value area or when the interval mode is LOWER or HIGHER, that is, when one numerical parameter is needed. The target reference defines the reference in which the shapes will be defined.The interval levels define the different heights on which the contours will be calculated. They should be ordered from low to high. The special values define the values which are not heights around which specific contours should be created.
Note that, when the current thread is interrupted,
null
is returned.- Parameters:
aLOSCoverageMatrix
- The matrix to convert.aTargetReference
- The target reference in which the polygons are defined.aIntervalMode
- The interval mode to use by the contour finder. When INTERVAL is given, the contours for all levels will be disjoint, "donut-shaped" complex polygons. When LOWER or HIGHER is given, the complex polygons will overlap but may have less edges. When LOWER is used, the complex polygons need to be drawn in inverse order of return.aContourIntervalLevels
- Contour values for intervalsaContourSpecialValues
- Contour values for special values- Returns:
- a contour representation of the given coverage matrix.
- Throws:
NullPointerException
- when anull
argument is found.IllegalArgumentException
- when a height level or special value is invalid.
-
createLOSCoverageContours(ILcdLOSCoverageMatrix, com.luciad.reference.ILcdGeoReference, com.luciad.contour.TLcdComplexPolygonContourFinder.IntervalMode, double[], double[])
instead.