| java.lang.Object org.geotools.coverage.grid.ViewType
ViewType | final public class ViewType implements Serializable(Code) | | Enumerates different "views" over a given coverage. Coverage views represent the same data
in different ways. Some views are more appropriate than others depending of the kind of work
to be performed. For example numerical computations on meteorological or oceanographical data
should be performed on the
view, while renderings are
better performed with the
view.
Different views are sometime synonymous for a given coverage. For example the
and
views are identical
when the coverage values are unsigned 8 or 16 bits integers, but distincts if the native
values are signed integers. This is because in the later case, the negative values
can not be processed directly by an
.
since: 2.4 version: $Id: ViewType.java 23398 2006-12-12 05:57:00Z desruisseaux $ author: Martin Desruisseaux |
Field Summary | |
final public static ViewType | DISPLAYABLE Coverage data are compatible with common Java2D
.
This usually imply that values are restricted to unsigned integers. | final public static ViewType | GEOPHYSICS Coverage data are the values of some geophysics phenomenon, for example an elevation
in metres or a temperature in Celsius degrees. | final public static ViewType | NATIVE Coverage data come directly from some source (typically a file) and are unprocessed.
This view doesn't have any of the restrictions imposed by other views: values may be
integers or floating point values, negative values are allowed, and missing data may
be represented by "pad values" like -9999. | final public static ViewType | PHOTOGRAPHIC Coverage data have no meaning other than visual color. |
DISPLAYABLE | final public static ViewType DISPLAYABLE(Code) | | Coverage data are compatible with common Java2D
.
This usually imply that values are restricted to unsigned integers. This view is often
identical to the
view if the values on the originating
device were already unsigned.
Conversions to the RGB color space are not allowed, because the data are often related
to
values in some way. For example the coverage may
contains Sea Surface Temperature (SST) data packed as 8 bits integers and
convertible to degrees Celsius using the following formula: temperature =
pixel_value × 0.15 - 3. A conversion to RGB space would lose this
relationship, and any oceanographical calculation accidentaly performed on this space
would produce wrong results.
Interpolations other than
are not
allowed, because some special values are often used as pad values for missing data. An
interpolation between a "real" value (for example a value convertible to the above-cited
SST) and "pad" value would produce a wrong result.
|
GEOPHYSICS | final public static ViewType GEOPHYSICS(Code) | | Coverage data are the values of some geophysics phenomenon, for example an elevation
in metres or a temperature in Celsius degrees. Values are typically floating point
numbers (
float or
double primitive type), but this is not mandatory
if there is never fractional parts or missing values in a particular coverage.
If the coverage contains some "no data" values, then those missing values
must be represented by
Float.NaN or
Double.NaN constant, or any other value in the NaN range as
. Real numbers used as "pad values" like
-9999 are
not allowed.
Interpolations (
,
, etc.) are allowed.
If there is some missing values around the interpolation point, then the
result is a
NaN value.
Conversions to RGB color space is not allowed. All computations (including
interpolations) must be performed in this geophysics space.
|
NATIVE | final public static ViewType NATIVE(Code) | | Coverage data come directly from some source (typically a file) and are unprocessed.
This view doesn't have any of the restrictions imposed by other views: values may be
integers or floating point values, negative values are allowed, and missing data may
be represented by "pad values" like -9999. This view is generally not suitable for
renderings or numerical computations. However in some special cases, this view may
be identical to an other view (see those other views for a more exhaustive list of
their conditions):
- If the values are stored as unsigned integers, then the native view may
be identical to the
view.
- If all missing values are represented by
, then the native view may be identical to the
view.
Interpolations other than
are
not allowed. Conversions to the RGB color space are not allowed neither, for the
same reasons than the
view.
|
PHOTOGRAPHIC | final public static ViewType PHOTOGRAPHIC(Code) | | Coverage data have no meaning other than visual color. It is not an elevation map for
example (in which case the coverage would rather be described as
).
Conversions to the RGB color space are allowed. Because the coverage has no geophysics
meaning other than visual color, there is no significant data lose in the replacement
of
.
Interpolation are not allowed on indexed values. They must be performed on the RGB
or similar color space instead.
|
equals | public boolean equals(Object object)(Code) | | Compares this enum with the specified object for equality.
|
hashCode | public int hashCode()(Code) | | Returns a hash value for this enum.
|
isColorSpaceConversionAllowed | public boolean isColorSpaceConversionAllowed()(Code) | | Returns
true if the replacement of
is allowed. Such replacements may occurs during some operations requirying interpolations,
like
, in order to produce images that look nicer.
However such replacements should be attempted only in last resort (interpolations in the
space should be preferred) and only if the coverage
data don't have any meaning other than visual color, as in
images.
See Also: JAI.KEY_REPLACE_INDEX_COLOR_MODEL |
isInterpolationAllowed | public boolean isInterpolationAllowed()(Code) | | Returns
true if interpolations other than
are allowed. Those interpolations require the following conditions:
- Values are either
values, or related to
geophysics values through a linear relationship over all the range of possible
values (including "no data" values).
- There is no "pad values". Missing values, if any, are represented by some
Float.NaN NaN values}.
This method may conservatively returns
false if unsure. If interpolations
are wanted but not allowed, then users should try to convert the coverage to the
space, which supports interpolations. If no
geophysics view is available, then users may convert the image to the RGB space
if
.
Interpolations in the RGB space produce nice-looking images, but the pixel values
lose all geophysical meaning. If the color space conversion is not allowed, then
then users should stick with
interpolation.
|
toString | public String toString()(Code) | | Returns a string representation of this enum.
|
|
|