Package com.luciad.format.raster
Class TLcdLinearRasterValueConverter
java.lang.Object
com.luciad.format.raster.TLcdLinearRasterValueConverter
- All Implemented Interfaces:
ILcdRasterValueConverter
A raster value converter that uses a linear transformation to convert between raster and data values.
When converting from raster values to data values, the following formula is used:
D = (clamp(R, minR, maxR) - O) / S
When converting from data values to raster values, the following formula is used:
R = clamp(D * S + O, minR, maxR)
With:
D
: the data valueR
: the raster valueminR
: the minimum raster valuemaxR
: the maximum raster valueO
: the offset to applyS
: the scale to apply
- Since:
- 2013.0
-
Constructor Summary
ConstructorDescriptionTLcdLinearRasterValueConverter
(int aMinRasterValue, int aMaxRasterValue, double aDataToRasterOffset, double aDataToRasterScale, int aDefaultRasterValue, ILcdISO19103UnitOfMeasure aUnit) Creates a new raster value converter that uses a linear transformation to convert between raster values and data values. -
Method Summary
Modifier and TypeMethodDescriptionint
dataToRaster
(double aDataValue) Converts data values to raster values.getUnit()
Returns the unit of the data values.double
rasterToData
(int aRasterValue) Converts raster values to data values.
-
Constructor Details
-
TLcdLinearRasterValueConverter
public TLcdLinearRasterValueConverter(int aMinRasterValue, int aMaxRasterValue, double aDataToRasterOffset, double aDataToRasterScale, int aDefaultRasterValue, ILcdISO19103UnitOfMeasure aUnit) Creates a new raster value converter that uses a linear transformation to convert between raster values and data values. For this it used an offset and a scale parameter. See the class docs for more information about how these parameters are used.- Parameters:
aMinRasterValue
- the minimal raster valueaMaxRasterValue
- the maximal raster valueaDataToRasterOffset
- the offset to apply.aDataToRasterScale
- the scale to apply.aDefaultRasterValue
- the default raster value.aUnit
- the unit of the data values.
-
-
Method Details
-
dataToRaster
public int dataToRaster(double aDataValue) Description copied from interface:ILcdRasterValueConverter
Converts data values to raster values.- Specified by:
dataToRaster
in interfaceILcdRasterValueConverter
- Parameters:
aDataValue
- the data value.- Returns:
- the raster value.
-
rasterToData
public double rasterToData(int aRasterValue) Description copied from interface:ILcdRasterValueConverter
Converts raster values to data values.- Specified by:
rasterToData
in interfaceILcdRasterValueConverter
- Parameters:
aRasterValue
- the raster value.- Returns:
- the data value.
-
getUnit
Description copied from interface:ILcdRasterValueConverter
Returns the unit of the data values.- Specified by:
getUnit
in interfaceILcdRasterValueConverter
- Returns:
- the unit of the data values. Can be
null
.
-