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 longSerial 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) CategoryReturnsthissince the values represented byConvertedCategoryare already converted.forConvertedValues(boolean converted) Returns a category that describes real values or sample values, depending ifconvertedistrueorfalserespectively.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.toConverseof this category will convert real value in specifiedunitsto 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-trueif we are construction a quantitative category, orfalsefor qualitative.units- the units of measurement, ornullif not applicable. This is the source units before conversion bytoSamples.- Throws:
org.opengis.referencing.operation.TransformException
-
-
Method Details
-
converted
Category converted()Returnsthissince the values represented byConvertedCategoryare already converted. -
forConvertedValues
Returns a category that describes real values or sample values, depending ifconvertedistrueorfalserespectively.- Overrides:
forConvertedValuesin classCategory- Parameters:
converted-truefor a category describing converted values, orfalsefor a category describing packed values.- Returns:
- a category describing converted or packed values, depending on
convertedargument value. May bethisbut 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:
getTransferFunctionin classCategory- Returns:
- the transfer function from sample values to real values.
- See Also:
-