Java Doc for Category.java in  » GIS » GeoTools-2.4.1 » org » geotools » coverage » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.coverage 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.coverage.Category

All known Subclasses:   org.geotools.coverage.GeophysicsCategory,
Category
public class Category implements Serializable(Code)
A category delimited by a range of sample values. A categogy may be either qualitative or quantitative. For exemple, a classified image may have a qualitative category defining sample value 0 as water. An other qualitative category may defines sample value 1 as forest, etc. An other image may define elevation data as sample values in the range [0..100] . The later is a quantitative category, because sample values are related to some measurement in the real world. For example, elevation data may be related to an altitude in metres through the following linear relation: altitude = sample value×100. Some image mixes both qualitative and quantitative categories. For example, images of Sea Surface Temperature (SST) may have a quantitative category for temperature with values ranging from –2 to 35°C, and three qualitative categories for cloud, land and ice.

All categories must have a human readable name. In addition, quantitative categories may define a transformation between sample values s and geophysics values x. This transformation is usually (but not always) a linear equation of the form:

x =   +  ×s

More general equation are allowed. For example, SeaWiFS images use a logarithmic transform. General transformations are expressed with a MathTransform1D object. In the special case where the transformation is a linear one (as in the formula above), then a Category object may be understood as the interval between two breakpoints in the JAI's operation.

All Category objects are immutable and thread-safe.
since:
   2.1
version:
   $Id: Category.java 26695 2007-08-23 18:58:56Z desruisseaux $
author:
   Martin Desruisseaux
See Also:   GridSampleDimension
See Also:   PiecewiseDescriptor



Field Summary
final public static  CategoryFALSE
     A default category for the boolean " Boolean.FALSE false " value.
final public static  CategoryNODATA
     A default category for "no data" values.
final public static  CategoryTRUE
     A default category for the boolean " Boolean.TRUE true " value.
final  Categoryinverse
     A reference to the GeophysicsCategory .
final  doublemaximum
     The maximal sample value (inclusive).
final  doubleminimum
     The minimal sample value (inclusive).
 NumberRangerange
     The range of values [minimum..maximum] .
final  MathTransform1Dtransform
     The math transform from sample to geophysics values (never null ). If this category is an instance of GeophysicsCategory , then this transform is the inverse (as computed by MathTransform.inverse ), except for qualitative categories.

Constructor Summary
public  Category(CharSequence name, Color color, boolean sample)
     Constructs a qualitative category for a boolean value.
public  Category(CharSequence name, Color color, int sample)
     Constructs a qualitative category for sample value sample .
public  Category(CharSequence name, Color color, double sample)
     Constructs a qualitative category for sample value sample .
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sample - The sample value as a double.
public  Category(CharSequence name, Color color, NumberRange sampleValueRange)
     Constructs a quantitative category for samples in the specified range.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sampleValueRange - The range of sample values for this category.
public  Category(CharSequence name, Color[] colors, int lower, int upper, double scale, double offset)
     Constructs a quantitative category for sample values ranging from lower inclusive to upper exclusive.
public  Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, double scale, double offset)
     Constructs a quantitative category for sample values in the specified range. Sample values are converted into geophysics values using the following linear equation:
x =   +  ×s

Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category.
public  Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, NumberRange geophysicsValueRange)
     Constructs a quantitative category mapping samples to geophysics values in the specified range.
public  Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, MathTransform1D sampleToGeophysics)
     Constructs a qualitative or quantitative category for samples in the specified range. Sample values (usually integers) will be converted into geophysics values (usually floating-point) through the sampleToGeophysics transform.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category.
 Category(Category inverse, boolean isQuantitative)
     Construct a geophysics category.

Method Summary
static  MathTransform1DcreateLinearTransform(double scale, double offset)
     Returns a linear transform with the supplied scale and offset values.
Parameters:
  scale - The scale factor.
static  voidensureNonNull(String name, Object object)
     Makes sure that an argument is non-null.
public  booleanequals(Object object)
     Compares the specified object with this category for equality.
public  Categorygeophysics(boolean geo)
     If true , returns the geophysics companion of this category.
public  Color[]getColors()
     Returns the set of colors for this category.
public  InternationalStringgetName()
     Returns the category name.
public  NumberRangegetRange()
     Returns the range of sample values occurring in this category.
public  MathTransform1DgetSampleToGeophysics()
     Returns a transform from sample values to geophysics values.
public  inthashCode()
     Returns a hash value for this category.
public  booleanisQuantitative()
     Returns true if this category is quantitative.
public  Categoryrecolor(Color[] colors)
     Returns a category for the same range of sample values but a different color palette. The array given in argument may have any length; colors will be interpolated as needed. An array of length 1 means that an uniform color should be used for all sample values. An array of length 0 or a null array means that some default colors should be used (usually a gradient from opaque black to opaque white).
Parameters:
  colors - A set of colors for the new category.
public  Categoryrescale(MathTransform1D sampleToGeophysics)
     Changes the mapping from sample to geophysics values.
public  StringtoString()
     Returns a string representation of this category.

Field Detail
FALSE
final public static Category FALSE(Code)
A default category for the boolean " Boolean.FALSE false " value. This default identity category uses sample value 0, the color and the name "false" localized to the specified locale.



NODATA
final public static Category NODATA(Code)
A default category for "no data" values. This default qualitative category use sample value 0, which is mapped to geophysics value Float.NaN for those who work with floating point images. The rendering color default to a fully transparent color and the name is "no data" localized to the requested locale.



TRUE
final public static Category TRUE(Code)
A default category for the boolean " Boolean.TRUE true " value. This default identity category uses sample value 1, the color and the name "true" localized to the specified locale.



inverse
final Category inverse(Code)
A reference to the GeophysicsCategory . If this category is already an instance of GeophysicsCategory , then inverse is a reference to the Category object that own it.



maximum
final double maximum(Code)
The maximal sample value (inclusive). This category is made of all values in the range minimum to maximum inclusive. If this category is an instance of GeophysicsCategory , then this field is the maximal geophysics value in this category. For qualitative categories, the geophysics value is one of NaN values.



minimum
final double minimum(Code)
The minimal sample value (inclusive). This category is made of all values in the range minimum to maximum inclusive. If this category is an instance of GeophysicsCategory , then this field is the minimal geophysics value in this category. For qualitative categories, the geophysics value is one of NaN values.



range
NumberRange range(Code)
The range of values [minimum..maximum] . May be computed only when first requested, or may be user-supplied (which is why it must be serialized).



transform
final MathTransform1D transform(Code)
The math transform from sample to geophysics values (never null ). If this category is an instance of GeophysicsCategory , then this transform is the inverse (as computed by MathTransform.inverse ), except for qualitative categories. Since Category.getSampleToGeophysics returns null for qualitative categories, this difference is not visible to the user.
See Also:   GridSampleDimension.getScale
See Also:   GridSampleDimension.getOffset




Constructor Detail
Category
public Category(CharSequence name, Color color, boolean sample)(Code)
Constructs a qualitative category for a boolean value.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sample - The sample value as a boolean.



Category
public Category(CharSequence name, Color color, int sample)(Code)
Constructs a qualitative category for sample value sample .
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sample - The sample value as an integer, usually in the range 0 to 255.



Category
public Category(CharSequence name, Color color, double sample)(Code)
Constructs a qualitative category for sample value sample .
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sample - The sample value as a double. May be one of NaN values.



Category
public Category(CharSequence name, Color color, NumberRange sampleValueRange) throws IllegalArgumentException(Code)
Constructs a quantitative category for samples in the specified range.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  color - The category color, or null for a default color.
Parameters:
  sampleValueRange - The range of sample values for this category. Element classis usually Integer, but Float and Double areaccepted as well.



Category
public Category(CharSequence name, Color[] colors, int lower, int upper, double scale, double offset) throws IllegalArgumentException(Code)
Constructs a quantitative category for sample values ranging from lower inclusive to upper exclusive. Sample values are converted into geophysics values using the following linear equation:
x =   +  ×s

Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category. This array may have any length;colors will be interpolated as needed. An array of length 1 meansthat an uniform color should be used for all sample values. An arrayof length 0 or a null array means that some default colorsshould be used (usually a gradient from opaque black to opaque white).
Parameters:
  lower - The lower sample value, inclusive.
Parameters:
  upper - The upper sample value, exclusive.
Parameters:
  scale - The GridSampleDimension.getScale scale value which ismultiplied to sample values for this category.
Parameters:
  offset - The GridSampleDimension.getOffset offset value to addto sample values for this category.
throws:
  IllegalArgumentException - if lower is not smaller than upper .
throws:
  IllegalArgumentException - if scale or offset are not real numbers.



Category
public Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, double scale, double offset) throws IllegalArgumentException(Code)
Constructs a quantitative category for sample values in the specified range. Sample values are converted into geophysics values using the following linear equation:
x =   +  ×s

Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category. This array may have any length;colors will be interpolated as needed. An array of length 1 meansthat an uniform color should be used for all sample values. An arrayof length 0 or a null array means that some default colorsshould be used (usually a gradient from opaque black to opaque white).
Parameters:
  sampleValueRange - The range of sample values for this category. Element classis usually Integer, but Float and Double areaccepted as well.
Parameters:
  scale - The GridSampleDimension.getScale scale value which ismultiplied to sample values for this category.
Parameters:
  offset - The GridSampleDimension.getOffset offset value to addto sample values for this category.
throws:
  IllegalArgumentException - if lower is not smaller than upper .
throws:
  IllegalArgumentException - if scale or offset are not real numbers.



Category
public Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, NumberRange geophysicsValueRange) throws IllegalArgumentException(Code)
Constructs a quantitative category mapping samples to geophysics values in the specified range. Sample values in the sampleValueRange will be mapped to geophysics values in the geophysicsValueRange through a linear equation of the form:
x =   +  ×s
scale and offset coefficients are computed from the ranges supplied in arguments.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category. This array may have any length;colors will be interpolated as needed. An array of length 1 meansthat an uniform color should be used for all sample values. An arrayof length 0 or a null array means that some default colorsshould be used (usually a gradient from opaque black to opaque white).
Parameters:
  sampleValueRange - The range of sample values for this category. Element classis usually Integer, but Float and Double areaccepted as well.
Parameters:
  geophysicsValueRange - The range of geophysics values for this category.Element class is usually Float or Double.
throws:
  ClassCastException - if the range element class is not a Number subclass.
throws:
  IllegalArgumentException - if the range is invalid.



Category
public Category(CharSequence name, Color[] colors, NumberRange sampleValueRange, MathTransform1D sampleToGeophysics) throws IllegalArgumentException(Code)
Constructs a qualitative or quantitative category for samples in the specified range. Sample values (usually integers) will be converted into geophysics values (usually floating-point) through the sampleToGeophysics transform.
Parameters:
  name - The category name as a String or InternationalString object.
Parameters:
  colors - A set of colors for this category. This array may have any length;colors will be interpolated as needed. An array of length 1 meansthat an uniform color should be used for all sample values. An arrayof length 0 or a null array means that some default colorsshould be used (usually a gradient from opaque black to opaque white).
Parameters:
  sampleValueRange - The range of sample values for this category. Element classis usually Integer, but Float and Double areaccepted as well.
Parameters:
  sampleToGeophysics - A transform from sample values to geophysics values,or null if this category is not a quantitative one.
throws:
  ClassCastException - if the range element class is not a Number subclass.
throws:
  IllegalArgumentException - if the range is invalid.



Category
Category(Category inverse, boolean isQuantitative) throws TransformException(Code)
Construct a geophysics category. This constructor should never be invoked outside GeophysicsCategory constructor.
Parameters:
  inverse - The originating Category.
Parameters:
  isQuantitative - true if the originating category is quantitative.
throws:
  TransformException - if a transformation failed.GeophysicsCategory.getRange




Method Detail
createLinearTransform
static MathTransform1D createLinearTransform(double scale, double offset)(Code)
Returns a linear transform with the supplied scale and offset values.
Parameters:
  scale - The scale factor. May be 0 for a constant transform.
Parameters:
  offset - The offset value. May be NaN if this method is invoked from a constructorfor initializing Category.transform for a qualitative category.



ensureNonNull
static void ensureNonNull(String name, Object object) throws IllegalArgumentException(Code)
Makes sure that an argument is non-null.
Parameters:
  name - Argument name.
Parameters:
  object - User argument.
throws:
  IllegalArgumentException - if object is null.



equals
public boolean equals(Object object)(Code)
Compares the specified object with this category for equality.



geophysics
public Category geophysics(boolean geo)(Code)
If true , returns the geophysics companion of this category. By definition, a geophysics category is a category with a transformed in such a way that the Category.getSampleToGeophysics sampleToGeophysics transform is always the identity transform, or null if no such transform existed in the first place. In other words, the range of sample values in a geophysics category maps directly the "real world" values without the need for any transformation.

Category objects live by pair: a geophysics one (used for computation) and a non-geophysics one (used for packing data, usually as integers). The geo argument specifies which object from the pair is wanted, regardless if this method is invoked on the geophysics or non-geophysics instance of the pair. In other words, the result of geophysics(b1).geophysics(b2).geophysics(b3) depends only on the value in the last call ( b3 ).

Newly constructed categories are non-geophysics (i.e. a transform must be applied in order to gets geophysics values).
Parameters:
  geo - true to get a category with an identity and a matching the geophysics values, or false to get back theoriginal category (the one constructed with new Category(...) ). The category. Never null , but may be this .
See Also:   GridSampleDimension.geophysics
See Also:   org.geotools.coverage.grid.GridCoverage2D.geophysics




getColors
public Color[] getColors()(Code)
Returns the set of colors for this category. Change to the returned array will not affect this category.
See Also:   GridSampleDimension.getColorModel



getName
public InternationalString getName()(Code)
Returns the category name.



getRange
public NumberRange getRange()(Code)
Returns the range of sample values occurring in this category. Sample values can be transformed into geophysics values using the Category.getSampleToGeophysics transform. The range of sample values.
See Also:   NumberRange.getMinimum(boolean)
See Also:   NumberRange.getMaximum(boolean)
See Also:   GridSampleDimension.getMinimumValue
See Also:   GridSampleDimension.getMaximumValue



getSampleToGeophysics
public MathTransform1D getSampleToGeophysics()(Code)
Returns a transform from sample values to geophysics values. If this category is not a quantitative one, then this method returns null .



hashCode
public int hashCode()(Code)
Returns a hash value for this category. This value need not remain consistent between different implementations of the same class.



isQuantitative
public boolean isQuantitative()(Code)
Returns true if this category is quantitative. A quantitative category has a non-null Category.getSampleToGeophysics() sampleToGeophysics transform. true if this category is quantitative, or false if this category is qualitative.



recolor
public Category recolor(Color[] colors)(Code)
Returns a category for the same range of sample values but a different color palette. The array given in argument may have any length; colors will be interpolated as needed. An array of length 1 means that an uniform color should be used for all sample values. An array of length 0 or a null array means that some default colors should be used (usually a gradient from opaque black to opaque white).
Parameters:
  colors - A set of colors for the new category. A category with the new color palette, or this if the new colors are identical to the current ones.
See Also:   org.geotools.coverage.processing.ColorMap.recolor



rescale
public Category rescale(MathTransform1D sampleToGeophysics)(Code)
Changes the mapping from sample to geophysics values. This method returns a category with a " " transformation set to the specified one. Other properties like the and the are unchanged.

Note about geophysics categories: The above rules are straightforward when applied on non-geophysics category, but this method can be invoked on geophysics category (as returned by (true)) as well. Since geophysics categories are already the result of some "sample to geophysics" transformation, invoking this method on those is equivalent to this "sample to geophysics" transform with the specified one.
Parameters:
  sampleToGeophysics - The new transform. A category using the specified transform.
See Also:   Category.getSampleToGeophysics
See Also:   GridSampleDimension.rescale




toString
public String toString()(Code)
Returns a string representation of this category. The returned string is implementation dependent. It is usually provided for debugging purposes.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.