Package org.apache.sis.coverage
Class ConvertedCategory
java.lang.Object
org.apache.sis.coverage.Category
org.apache.sis.coverage.ConvertedCategory
- All Implemented Interfaces:
Serializable
A category of "real values" range. Sample values in this category are equal to real values.
By definition, the
getTransferFunction()
method for this class returns the identity transform,
or an empty optional if this category is a qualitative one.- Since:
- 1.0
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.coverage.Category
COMPARATOR, converse, name, range, toConverse
-
Constructor Summary
ConstructorsConstructorDescriptionConvertedCategory
(Category original, org.opengis.referencing.operation.MathTransform1D toSamples, boolean isQuantitative, javax.measure.Unit<?> units) Creates a category storing the inverse of the "sample to real values" transfer function. -
Method Summary
Modifier and TypeMethodDescription(package private) Category
Returnsthis
since the values represented byConvertedCategory
are already converted.forConvertedValues
(boolean converted) Returns a category that describes real values or sample values, depending ifconverted
istrue
orfalse
respectively.Optional
<org.opengis.referencing.operation.MathTransform1D> Returns the transfer function from sample values to real values in units of measurement.Methods inherited from class org.apache.sis.coverage.Category
compare, equals, getMeasurementRange, getName, getRangeLabel, getSampleRange, hashCode, identity, isConvertedQualitative, isQuantitative, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
-
Constructor Details
-
ConvertedCategory
ConvertedCategory(Category original, org.opengis.referencing.operation.MathTransform1D toSamples, boolean isQuantitative, javax.measure.Unit<?> units) throws org.opengis.referencing.operation.TransformException Creates a category storing the inverse of the "sample to real values" transfer function. TheCategory.toConverse
of this category will convert real value in specifiedunits
to the sample (packed) value.- Parameters:
original
- the category storing the conversion from sample to real value.toSamples
- the "real to sample values" conversion, as the inverse oforiginal.transferFunction
. For qualitative category, this function is a constant mapping NaN to the original sample value.isQuantitative
-true
if we are construction a quantitative category, orfalse
for qualitative.units
- the units of measurement, ornull
if not applicable. This is the source units before conversion bytoSamples
.- Throws:
org.opengis.referencing.operation.TransformException
-
-
Method Details
-
converted
Category converted()Returnsthis
since the values represented byConvertedCategory
are already converted. -
forConvertedValues
Returns a category that describes real values or sample values, depending ifconverted
istrue
orfalse
respectively.- Overrides:
forConvertedValues
in classCategory
- Parameters:
converted
-true
for a category describing converted values, orfalse
for a category describing packed values.- Returns:
- a category describing converted or packed values, depending on
converted
argument value. May bethis
but nevernull
. - See Also:
-
getTransferFunction
Returns the transfer function from sample values to real values in units of measurement. The function is absent if this category is not a quantitative category.- Overrides:
getTransferFunction
in classCategory
- Returns:
- the transfer function from sample values to real values.
- See Also:
-