Package com.luciad.network.function
Class ALcdCrossCountryRasterDistanceFunction
java.lang.Object
com.luciad.network.function.ALcdCrossCountryRasterDistanceFunction
- All Implemented Interfaces:
ILcdCrossCountryDistanceFunction
public abstract class ALcdCrossCountryRasterDistanceFunction
extends Object
implements ILcdCrossCountryDistanceFunction
ALcdCrossCountryRasterDistanceFunction
is an abstract class which can be used to
implement distance functions that are based on an ILcdRaster
and compute values
using only the raster values along the line between start and end point.
To use this class only the computeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double)
must still be implemented. This method will be called from the ILcdCrossCountryDistanceFunction.computeDistance(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint)
implementation of this class.- Since:
- 9.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Describes the mode in which the distances should be computed. -
Constructor Summary
ConstructorDescriptionConstructs a newALcdCrossCountryRasterDistanceFunction
based onaRaster
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract double
computeDistance
(ILcdPoint aStartPoint, double aStartValue, ILcdPoint aEndPoint, double aEndValue) Computes the distance between 2 points.double
computeDistance
(ILcdPoint aStartPoint, ILcdPoint aEndPoint) This method will call thecomputeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double)
method a number of times, depending on the computation mode, to compute the distance between the specified points.Returns the bounds of theILcdRaster
on which this distance function is based.Returns the mode in which the distance computations are performed.Returns theILcdRaster
on which this distance function is based.void
setComputationMode
(ALcdCrossCountryRasterDistanceFunction.ComputationMode aComputationMode) Sets the mode in which the distance computations are be performed.
-
Constructor Details
-
ALcdCrossCountryRasterDistanceFunction
Constructs a newALcdCrossCountryRasterDistanceFunction
based onaRaster
. The distances will be computed in theALcdCrossCountryRasterDistanceFunction.ComputationMode.PRECISE
mode.- Parameters:
aRaster
- theILcdRaster
the distance function is based on
-
-
Method Details
-
getComputationMode
Returns the mode in which the distance computations are performed.- Returns:
- the mode in which the distance computations are performed
-
setComputationMode
public void setComputationMode(ALcdCrossCountryRasterDistanceFunction.ComputationMode aComputationMode) Sets the mode in which the distance computations are be performed.- Parameters:
aComputationMode
- the mode in which the distance computations should be performed- Throws:
NullPointerException
- if the specified computation mode isnull
-
getRaster
Returns theILcdRaster
on which this distance function is based.- Returns:
- the
ILcdRaster
on which this distance function is based
-
computeDistance
protected abstract double computeDistance(ILcdPoint aStartPoint, double aStartValue, ILcdPoint aEndPoint, double aEndValue) Computes the distance between 2 points.- Parameters:
aStartPoint
- the start pointaStartValue
- the raster value at the start pointaEndPoint
- the end pointaEndValue
- the raster value at the end point- Returns:
- the distance between
aStartPoint
and aEndPoint.
-
computeDistance
This method will call thecomputeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double)
method a number of times, depending on the computation mode, to compute the distance between the specified points.- Specified by:
computeDistance
in interfaceILcdCrossCountryDistanceFunction
- Parameters:
aStartPoint
- the start point.aEndPoint
- the end point.- Returns:
- the distance from
aStartPoint
toaEndPoint
.
-
getBounds
Returns the bounds of theILcdRaster
on which this distance function is based.- Specified by:
getBounds
in interfaceILcdCrossCountryDistanceFunction
- Returns:
- the bounds in which this function can compute distances.
-