Java Doc for GridSampleDimension.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.GridSampleDimension

All known Subclasses:   org.geotools.coverage.grid.Grid2DSampleDimension,
GridSampleDimension
public class GridSampleDimension implements SampleDimension,Serializable(Code)
Describes the data values for a coverage as a list of . For a grid coverage a sample dimension is a band. Sample values in a band may be organized in categories. This GridSampleDimension implementation is capable to differenciate qualitative and quantitative categories. For example an image of sea surface temperature (SST) could very well defines the following categories:
 [0]       : no data
 [1]       : cloud
 [2]       : land
 [10..210] : temperature to be converted into Celsius degrees through a linear equation
 
In this example, sample values in range [10..210] defines a quantitative category, while all others categories are qualitative. The difference between those two kinds of category is that the Category.getSampleToGeophysics method returns a non-null transform if and only if the category is quantitative.

While this class can be used with arbitrary , the primary target for this implementation is storing their sample values as integers. This explain the " Grid " prefix in the class name.
since:
   2.1
version:
   $Id: GridSampleDimension.java 23398 2006-12-12 05:57:00Z desruisseaux $
author:
   Martin Desruisseaux



Field Summary
final  CategoryListcategories
     The category list for this sample dimension, or null if this sample dimension has no category.

Constructor Summary
public  GridSampleDimension()
     Constructs a sample dimension with no description and no category.
public  GridSampleDimension(CharSequence description)
     Constructs a sample dimension with specified name and no category.
Parameters:
  description - The sample dimension title or description, or null ifnone.
public  GridSampleDimension(CharSequence description, CharSequence[] categoriesNames)
     Constructs a sample dimension with a set of qualitative categories only. This constructor expects only a sequence of category names for the values contained in a sample dimension.
public  GridSampleDimension(CharSequence[] categoriesNames)
     Constructs a sample dimension with a set of qualitative categories only. This constructor expects only a sequence of category names for the values contained in a sample dimension.
public  GridSampleDimension(CharSequence description, CharSequence[] names, Color[] colors)
     Constructs a sample dimension with a set of qualitative categories and colors.
public  GridSampleDimension(CharSequence[] names, Color[] colors)
     Constructs a sample dimension with a set of qualitative categories and colors.
public  GridSampleDimension(CharSequence description, SampleDimensionType type, ColorInterpretation color, Color[] palette, CharSequence[] categories, double[] nodata, double minimum, double maximum, double scale, double offset, Unit unit)
     Constructs a sample dimension with the specified properties.
public  GridSampleDimension(CharSequence description, Category[] categories, Unit units)
     Constructs a sample dimension with an arbitrary set of categories, which may be both quantitative and qualitative.
public  GridSampleDimension(Category[] categories, Unit units)
     Constructs a sample dimension with an arbitrary set of categories, which may be both quantitative and qualitative.
protected  GridSampleDimension(GridSampleDimension other)
     Constructs a new sample dimension with the same categories and units than the specified sample dimension.

Method Summary
public  booleanequals(Object object)
     Compares the specified object with this sample dimension for equality.
public  GridSampleDimensiongeophysics(boolean geo)
     If true , returns the geophysics companion of this sample dimension.
public  CategorygetBackground()
     Returns a default category to use for background.
public  ListgetCategories()
     Returns all categories in this sample dimension.
public  CategorygetCategory(double sample)
     Returns the category for the specified sample value.
public  InternationalString[]getCategoryNames()
     Returns a sequence of category names for the values contained in this sample dimension. This allows for names to be assigned to numerical values.
public  ColorInterpretationgetColorInterpretation()
     Returns the color interpretation of the sample dimension. A sample dimension can be an index into a color palette or be a color model component.
public  ColorModelgetColorModel()
     Returns a color model for this sample dimension.
public  ColorModelgetColorModel(int visibleBand, int numBands)
     Returns a color model for this sample dimension.
public  ColorModelgetColorModel(int visibleBand, int numBands, int type)
     Returns a color model for this sample dimension.
public  InternationalStringgetDescription()
     Get the sample dimension title or description.
public  StringgetLabel(double value, Locale locale)
     Returns a string representation of a sample value.
public  doublegetMaximumValue()
     Returns the maximum value occurring in this sample dimension. The default implementation fetch this value from the categories supplied at construction time.
public  String[]getMetaDataNames()
     The list of metadata keywords for a sample dimension.
public  StringgetMetadataValue(String name)
     Retrieve the metadata value for a given metadata name.
Parameters:
  name - Metadata keyword for which to retrieve metadata.
public  doublegetMinimumValue()
     Returns the minimum value occurring in this sample dimension. The default implementation fetch this value from the categories supplied at construction time.
public  double[]getNoDataValues()
     Returns the values to indicate "no data" for this sample dimension.
public  doublegetOffset()
     Returns the value to add to grid values for this sample dimension. This attribute is typically used when the sample dimension represents elevation data.
public  int[][]getPalette()
     Color palette associated with the sample dimension.
public  PaletteInterpretationgetPaletteInterpretation()
     Indicates the type of color palette entry for sample dimensions which have a palette.
public  NumberRangegetRange()
     Returns the range of values in this sample dimension.
public  SampleDimensionTypegetSampleDimensionType()
     Returns a code value indicating grid value data type.
public  MathTransform1DgetSampleToGeophysics()
     Returns a transform from sample values to geophysics values.
public  doublegetScale()
     Returns the value which is multiplied to grid values for this sample dimension. This attribute is typically used when the sample dimension represents elevation data.
public  UnitgetUnits()
     Returns the unit information for this sample dimension.
public  inthashCode()
     Returns a hash value for this sample dimension.
public  GridSampleDimensionrescale(double scale, double offset)
     Returns a sample dimension using new GridSampleDimension.getScale scale and GridSampleDimension.getOffset offset coefficients.
public  StringtoString()
     Returns a string representation of this sample dimension. This string is for debugging purpose only and may change in future version.
public static  GridSampleDimensionwrap(SampleDimension sd)
     Wrap the specified OpenGIS's sample dimension into a Geotools's implementation of GridSampleDimension .

Field Detail
categories
final CategoryList categories(Code)
The category list for this sample dimension, or null if this sample dimension has no category. This field is read by SampleTranscoder only.




Constructor Detail
GridSampleDimension
public GridSampleDimension()(Code)
Constructs a sample dimension with no description and no category. GridSampleDimension.GridSampleDimension(CharSequence)



GridSampleDimension
public GridSampleDimension(CharSequence description)(Code)
Constructs a sample dimension with specified name and no category.
Parameters:
  description - The sample dimension title or description, or null ifnone. This is the value to be returned by GridSampleDimension.getDescription.
since:
   2.3



GridSampleDimension
public GridSampleDimension(CharSequence description, CharSequence[] categoriesNames)(Code)
Constructs a sample dimension with a set of qualitative categories only. This constructor expects only a sequence of category names for the values contained in a sample dimension. This allows for names to be assigned to numerical values. The first entry in the sequence relates to a cell value of zero. For example: [0]="Background", [1]="Water", [2]="Forest", [3]="Urban". The created sample dimension will have no unit and a default set of colors.
Parameters:
  description - The sample dimension title or description, or null for the default(the name of what looks like the "main" category). This is the value to bereturned by GridSampleDimension.getDescription.
Parameters:
  categoriesNames - Sequence of category names for the values contained in asample dimension, as String orInternationalString objects.
since:
   2.3



GridSampleDimension
public GridSampleDimension(CharSequence[] categoriesNames)(Code)
Constructs a sample dimension with a set of qualitative categories only. This constructor expects only a sequence of category names for the values contained in a sample dimension. This allows for names to be assigned to numerical values. The first entry in the sequence relates to a cell value of zero. For example: [0]="Background", [1]="Water", [2]="Forest", [3]="Urban". The created sample dimension will have no unit and a default set of colors.
Parameters:
  categoriesNames - Sequence of category names for the values contained in asample dimension, as String orInternationalString objects.GridSampleDimension.GridSampleDimension(CharSequence,CharSequence[])



GridSampleDimension
public GridSampleDimension(CharSequence description, CharSequence[] names, Color[] colors)(Code)
Constructs a sample dimension with a set of qualitative categories and colors. This constructor expects a sequence of category names for the values contained in a sample dimension. This allows for names to be assigned to numerical values. The first entry in the sequence relates to a cell value of zero. For example: [0]="Background", [1]="Water", [2]="Forest", [3]="Urban". The created sample dimension will have no unit and a default set of colors.
Parameters:
  description - The sample dimension title or description, or null for the default(the name of what looks like the "main" category). This is the value to bereturned by GridSampleDimension.getDescription.
Parameters:
  names - Sequence of category names for the values contained in asample dimension, as String orInternationalString objects.
Parameters:
  colors - Color to assign to each category. This array must have thesame length than names .
since:
   2.3



GridSampleDimension
public GridSampleDimension(CharSequence[] names, Color[] colors)(Code)
Constructs a sample dimension with a set of qualitative categories and colors. This constructor expects a sequence of category names for the values contained in a sample dimension. This allows for names to be assigned to numerical values. The first entry in the sequence relates to a cell value of zero. For example: [0]="Background", [1]="Water", [2]="Forest", [3]="Urban". The created sample dimension will have no unit and a default set of colors.
Parameters:
  names - Sequence of category names for the values contained in asample dimension, as String orInternationalString objects.
Parameters:
  colors - Color to assign to each category. This array must have thesame length than names .GridSampleDimension.GridSampleDimension(CharSequence,CharSequence[],Color[])



GridSampleDimension
public GridSampleDimension(CharSequence description, SampleDimensionType type, ColorInterpretation color, Color[] palette, CharSequence[] categories, double[] nodata, double minimum, double maximum, double scale, double offset, Unit unit)(Code)
Constructs a sample dimension with the specified properties. For convenience, any argument which is not a double primitive can be null , and any can be either a String or InternationalString object.

This constructor allows the construction of a GridSampleDimension without explicit construction of Category objects. An heuristic approach is used for dispatching the informations into a set of Category objects. However, this constructor still less general and provides less fine-grain control than the constructor expecting an array of Category objects.
Parameters:
  description - The sample dimension title or description, or null for the default(the name of what looks like the "main" category). This is the value to bereturned by GridSampleDimension.getDescription.
Parameters:
  type - The grid value data type (which indicate the number of bitsfor the data type), or null for computing itautomatically from the range [minimum..maximum] . Thisis the value to be returned by GridSampleDimension.getSampleDimensionType.
Parameters:
  color - The color interpretation, or null for a default value(usuallyColorInterpretation.PALETTE_INDEX PALETTE_INDEX).This is the value to be returned byGridSampleDimension.getColorInterpretation.
Parameters:
  palette - The color palette associated with the sample dimension, or null for a default color palette (usually grayscale).If categories is non-null, then both arrays usuallyhave the same length. However, this constructor is tolerant onthis array length. This is the value to be returned(indirectly) by GridSampleDimension.getColorModel.
Parameters:
  categories - A sequence of category names for the values contained in thesample dimension, or null if none. This is the valuesto be returned by GridSampleDimension.getCategoryNames.
Parameters:
  nodata - the values to indicate "no data", or null if none.This is the values to be returned by GridSampleDimension.getNoDataValues.
Parameters:
  minimum - The lower value, inclusive. The [minimum..maximum] range may or may not includes the nodata values; therange will be adjusted as needed. If categories wasnon-null, then minimum is usually 0. This is the valueto be returned by GridSampleDimension.getMinimumValue.
Parameters:
  maximum - The upper value, inclusive as well. The [minimum..maximum] range may or may not includes the nodata values; the range will be adjusted as needed.If categories was non-null, then maximum isusually equals to categories.length-1 . This is thevalue to be returned by GridSampleDimension.getMaximumValue.
Parameters:
  scale - The value which is multiplied to grid values, or 1 if none.This is the value to be returned by GridSampleDimension.getScale.
Parameters:
  offset - The value to add to grid values, or 0 if none. This is thevalue to be returned by GridSampleDimension.getOffset.
Parameters:
  unit - The unit information for this sample dimension, or null if none. This is the value to be returned byGridSampleDimension.getUnits.
throws:
  IllegalArgumentException - if the range [minimum..maximum] is not valid.




GridSampleDimension
public GridSampleDimension(CharSequence description, Category[] categories, Unit units) throws IllegalArgumentException(Code)
Constructs a sample dimension with an arbitrary set of categories, which may be both quantitative and qualitative. It is possible to specify more than one quantitative categories, providing that their sample value ranges do not overlap. Quantitative categories can map sample values to geophysics values using arbitrary relation (not necessarly linear).
Parameters:
  description - The sample dimension title or description, or null for the default(the name of what looks like the "main" category). This is the value to bereturned by GridSampleDimension.getDescription.
Parameters:
  categories - The list of categories.
Parameters:
  units - The unit information for this sample dimension. May be null if no category has units. This unit apply tovalues obtained after theGridSampleDimension.getSampleToGeophysics sampleToGeophysicstransformation.
throws:
  IllegalArgumentException - if categories contains incompatible categories. Ifmay be the case for example if two or more categories haveoverlapping ranges of sample values.
since:
   2.3



GridSampleDimension
public GridSampleDimension(Category[] categories, Unit units) throws IllegalArgumentException(Code)
Constructs a sample dimension with an arbitrary set of categories, which may be both quantitative and qualitative. It is possible to specify more than one quantitative categories, providing that their sample value ranges do not overlap. Quantitative categories can map sample values to geophysics values using arbitrary relation (not necessarly linear).
Parameters:
  categories - The list of categories.
Parameters:
  units - The unit information for this sample dimension. May be null if no category has units. This unit apply tovalues obtained after theGridSampleDimension.getSampleToGeophysics sampleToGeophysicstransformation.
throws:
  IllegalArgumentException - if categories contains incompatible categories. Ifmay be the case for example if two or more categories haveoverlapping ranges of sample values.GridSampleDimension.GridSampleDimension(CharSequence,Category[],Unit)



GridSampleDimension
protected GridSampleDimension(GridSampleDimension other)(Code)
Constructs a new sample dimension with the same categories and units than the specified sample dimension.
Parameters:
  other - The other sample dimension, or null .




Method Detail
equals
public boolean equals(Object object)(Code)
Compares the specified object with this sample dimension for equality.



geophysics
public GridSampleDimension geophysics(boolean geo)(Code)
If true , returns the geophysics companion of this sample dimension. By definition, a geophysics sample dimension is a sample dimension with a transformed in such a way that the GridSampleDimension.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 all category maps directly the "real world" values without the need for any transformation.

GridSampleDimension 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 ).
Parameters:
  geo - true to get a sample dimension with an identity and a matching the geophysics values, or false to get back theoriginal sample dimension. The sample dimension. Never null , but may be this .
See Also:   Category.geophysics
See Also:   org.geotools.coverage.grid.GridCoverage2D.geophysics




getBackground
public Category getBackground()(Code)
Returns a default category to use for background. A background category is used when an image is resampled (for example reprojected in an other coordinate system) and the resampled image do not fit in a rectangular area. It can also be used in various situation where a raisonable "no data" category is needed. The default implementation try to returns one of the . If no suitable category is found, then a one is returned. A category to use as background for the "Resample" operation. Never null .



getCategories
public List getCategories()(Code)
Returns all categories in this sample dimension. Note that a Category object may apply to an arbitrary range of sample values. Consequently, the first element in this collection may not be directly related to the sample value 0 . The list of categories in this sample dimension, or null if none.
See Also:   GridSampleDimension.getCategoryNames
See Also:   GridSampleDimension.getCategory



getCategory
public Category getCategory(double sample)(Code)
Returns the category for the specified sample value. If this method can't maps a category to the specified value, then it returns null .
Parameters:
  sample - The value (can be one of NaN values). The category for the supplied value, or null if none.
See Also:   GridSampleDimension.getCategories
See Also:   GridSampleDimension.getCategoryNames



getCategoryNames
public InternationalString[] getCategoryNames() throws IllegalStateException(Code)
Returns a sequence of category names for the values contained in this sample dimension. This allows for names to be assigned to numerical values. The first entry in the sequence relates to a cell value of zero. For example:
 [0] Background
 [1] Water
 [2] Forest
 [3] Urban
 
The sequence of category names for the values contained in this sample dimension,or null if there is no category in this sample dimension.
throws:
  IllegalStateException - if a sequence can't be mapped because some category usenegative or non-integer sample values.
See Also:   GridSampleDimension.getCategories
See Also:   GridSampleDimension.getCategory



getColorInterpretation
public ColorInterpretation getColorInterpretation()(Code)
Returns the color interpretation of the sample dimension. A sample dimension can be an index into a color palette or be a color model component. If the sample dimension is not assigned a color interpretation the value is ColorInterpretation.UNDEFINED .



getColorModel
public ColorModel getColorModel()(Code)
Returns a color model for this sample dimension. The default implementation create a color model with 1 band using each category's colors as returned by Category.getColors . The returned color model will typically use data type DataBuffer.TYPE_FLOAT if this GridSampleDimension instance is "geophysics", or an integer data type otherwise.

Note that org.geotools.coverage.grid.GridCoverage2D.getSampleDimension returns special implementations of GridSampleDimension . In this particular case, the color model created by this getColorModel() method will have the same number of bands than the grid coverage's RenderedImage . The requested color model, suitable for RenderedImage objects with valuesin the GridSampleDimension.getRange range. May be null if thissample dimension has no category.




getColorModel
public ColorModel getColorModel(int visibleBand, int numBands)(Code)
Returns a color model for this sample dimension. The default implementation create the color model using each category's colors as returned by Category.getColors . The returned color model will typically use data type DataBuffer.TYPE_FLOAT if this GridSampleDimension instance is "geophysics", or an integer data type otherwise.
Parameters:
  visibleBand - The band to be made visible (usually 0). All other bands, if anywill be ignored.
Parameters:
  numBands - The number of bands for the color model (usually 1). The returned colormodel will renderer only the visibleBand and ignore the others, butthe existence of all numBands will be at least tolerated. Supplementalbands, even invisible, are useful for processing with Java Advanced Imaging. The requested color model, suitable for RenderedImage objects with valuesin the GridSampleDimension.getRange range. May be null if thissample dimension has no category. SampleDimension SampleDimension



getColorModel
public ColorModel getColorModel(int visibleBand, int numBands, int type)(Code)
Returns a color model for this sample dimension. The default implementation create the color model using each category's colors as returned by Category.getColors .
Parameters:
  visibleBand - The band to be made visible (usually 0). All other bands, if anywill be ignored.
Parameters:
  numBands - The number of bands for the color model (usually 1). The returned colormodel will renderer only the visibleBand and ignore the others, butthe existence of all numBands will be at least tolerated. Supplementalbands, even invisible, are useful for processing with Java Advanced Imaging.
Parameters:
  type - The data type that has to be used for the sample model The requested color model, suitable for RenderedImage objects with valuesin the GridSampleDimension.getRange range. May be null if thissample dimension has no category. SampleDimension SampleDimension



getDescription
public InternationalString getDescription()(Code)
Get the sample dimension title or description. This string may be null if no description is present.



getLabel
public String getLabel(double value, Locale locale)(Code)
Returns a string representation of a sample value. This method try to returns a representation of the geophysics value; the transformation is automatically applied when necessary. More specifically:
  • If value maps a qualitative category, then the category name is returned as of Category.getName .
  • Otherwise, if value maps a quantitative category, then the value is transformed into a geophysics value as with the GridSampleDimension.getSampleToGeophysics()sampleToGeophysics transform, the result is formatted as a number and the unit symbol is appened.

Parameters:
  value - The sample value (can be one of NaN values).
Parameters:
  locale - Locale to use for formatting, or null for the default locale. A string representation of the geophysics value, or null if there isnone. GridSampleDimension null CategoryList



getMaximumValue
public double getMaximumValue()(Code)
Returns the maximum value occurring in this sample dimension. The default implementation fetch this value from the categories supplied at construction time. If the maximum value can't be computed, then this method returns Double.POSITIVE_INFINITY .
See Also:   GridSampleDimension.getRange



getMetaDataNames
public String[] getMetaDataNames()(Code)
The list of metadata keywords for a sample dimension. If no metadata is available, the sequence will be empty. The list of metadata keywords for a sample dimension.
See Also:   GridSampleDimension.getMetadataValue
See Also:   javax.media.jai.PropertySource.getPropertyNames



getMetadataValue
public String getMetadataValue(String name) throws MetadataNameNotFoundException(Code)
Retrieve the metadata value for a given metadata name.
Parameters:
  name - Metadata keyword for which to retrieve metadata. The metadata value for a given metadata name.
throws:
  MetadataNameNotFoundException - if there is no value for the specified metadata name.
See Also:   GridSampleDimension.getMetaDataNames
See Also:   javax.media.jai.PropertySource.getProperty



getMinimumValue
public double getMinimumValue()(Code)
Returns the minimum value occurring in this sample dimension. The default implementation fetch this value from the categories supplied at construction time. If the minimum value can't be computed, then this method returns Double.NEGATIVE_INFINITY .
See Also:   GridSampleDimension.getRange



getNoDataValues
public double[] getNoDataValues() throws IllegalStateException(Code)
Returns the values to indicate "no data" for this sample dimension. The default implementation deduces the "no data" values from the list of categories supplied at construction time. The rules are:
  • If GridSampleDimension.getSampleToGeophysics returns null , then getNoDataValues() returns null as well. This means that this sample dimension contains no category or contains only qualitative categories (e.g. a band from a classified image).
  • If GridSampleDimension.getSampleToGeophysics returns an identity transform, then getNoDataValues() returns null . This means that sample value in this sample dimension are already expressed in geophysics values and that all "no data" values (if any) have already been converted into NaN values.
  • Otherwise, if there is at least one quantitative category, returns the sample values of all non-quantitative categories. For example if "Temperature" is a quantitative category and "Land" and "Cloud" are two qualitative categories, then sample values for "Land" and "Cloud" will be considered as "no data" values. "No data" values that are already NaN will be ignored.
Together with GridSampleDimension.getOffset() and GridSampleDimension.getScale() , this method provides a limited way to transform sample values into geophysics values. However, the recommended way is to use the GridSampleDimension.getSampleToGeophysics sampleToGeophysics transform instead, which is more general and take care of converting automatically "no data" values into NaN . The values to indicate no data values for this sample dimension,or null if not applicable.
throws:
  IllegalStateException - if some qualitative categories use a range ofnon-integer values.
See Also:   GridSampleDimension.getSampleToGeophysics



getOffset
public double getOffset() throws IllegalStateException(Code)
Returns the value to add to grid values for this sample dimension. This attribute is typically used when the sample dimension represents elevation data. The transformation equation is:
offset + scale*sample
Together with GridSampleDimension.getScale() and GridSampleDimension.getNoDataValues() , this method provides a limited way to transform sample values into geophysics values. However, the recommended way is to use the GridSampleDimension.getSampleToGeophysics sampleToGeophysics transform instead, which is more general and take care of converting automatically "no data" values into NaN . The offset to add to grid values.
throws:
  IllegalStateException - if the transform from sample to geophysics valuesis not a linear relation.
See Also:   GridSampleDimension.getSampleToGeophysics
See Also:   GridSampleDimension.rescale



getPalette
public int[][] getPalette()(Code)
Color palette associated with the sample dimension. A color palette can have any number of colors. See palette interpretation for meaning of the palette entries. If the grid coverage has no color palette, null will be returned. The color palette associated with the sample dimension.
See Also:   GridSampleDimension.getPaletteInterpretation
See Also:   GridSampleDimension.getColorInterpretation
See Also:   IndexColorModel



getPaletteInterpretation
public PaletteInterpretation getPaletteInterpretation()(Code)
Indicates the type of color palette entry for sample dimensions which have a palette. If a sample dimension has a palette, the color interpretation must be ColorInterpretation.GRAY_INDEX GRAY_INDEX or ColorInterpretation.PALETTE_INDEX PALETTE_INDEX . A palette entry type can be Gray, RGB, CMYK or HLS. The type of color palette entry for sample dimensions which have a palette.



getRange
public NumberRange getRange()(Code)
Returns the range of values in this sample dimension. This is the union of the range of values of every categories, excluding NaN values. A NumberRange object gives more informations than GridSampleDimension.getMinimumValue and GridSampleDimension.getMaximumValue methods since it contains also the data type (integer, float, etc.) and inclusion/exclusion informations. The range of values. May be null if this sample dimension has noquantitative category.
See Also:   Category.getRange
See Also:   GridSampleDimension.getMinimumValue
See Also:   GridSampleDimension.getMaximumValue CategoryList.getRange() TypeMap.getSampleDimensionType(Range)



getSampleDimensionType
public SampleDimensionType getSampleDimensionType()(Code)
Returns a code value indicating grid value data type. This will also indicate the number of bits for the data type. a code value indicating grid value data type.



getSampleToGeophysics
public MathTransform1D getSampleToGeophysics()(Code)
Returns a transform from sample values to geophysics values. If this sample dimension has no category, then this method returns null . If all sample values are already geophysics values (including NaN for "no data" values), then this method returns an identity transform. Otherwise, this method returns a transform expecting sample values as input and computing geophysics value as output. This transform will take care of converting all " " into NaN values. The sampleToGeophysics. transform is capable to differenciate NaN values to get back the original sample value. The transform from sample to geophysics values, or null if thissample dimension do not defines any transform (which is not the same thatdefining an identity transform).
See Also:   GridSampleDimension.getScale
See Also:   GridSampleDimension.getOffset
See Also:   GridSampleDimension.getNoDataValues
See Also:   GridSampleDimension.rescale



getScale
public double getScale()(Code)
Returns the value which is multiplied to grid values for this sample dimension. This attribute is typically used when the sample dimension represents elevation data. The transformation equation is:
offset + scale*sample
Together with GridSampleDimension.getOffset() and GridSampleDimension.getNoDataValues() , this method provides a limited way to transform sample values into geophysics values. However, the recommended way is to use the GridSampleDimension.getSampleToGeophysics sampleToGeophysics transform instead, which is more general and take care of converting automatically "no data" values into NaN . The scale to multiply to grid value.
throws:
  IllegalStateException - if the transform from sample to geophysics valuesis not a linear relation.
See Also:   GridSampleDimension.getSampleToGeophysics
See Also:   GridSampleDimension.rescale



getUnits
public Unit getUnits()(Code)
Returns the unit information for this sample dimension. May returns null if this dimension has no units. This unit apply to values obtained after the GridSampleDimension.getSampleToGeophysicssampleToGeophysics transformation.
See Also:   GridSampleDimension.getSampleToGeophysics



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



rescale
public GridSampleDimension rescale(double scale, double offset)(Code)
Returns a sample dimension using new GridSampleDimension.getScale scale and GridSampleDimension.getOffset offset coefficients. Other properties like the , and are unchanged.
Parameters:
  scale - The value which is multiplied to grid values for the new sample dimension.
Parameters:
  offset - The value to add to grid values for the new sample dimension.
See Also:   GridSampleDimension.getScale
See Also:   GridSampleDimension.getOffset
See Also:   Category.rescale



toString
public String toString()(Code)
Returns a string representation of this sample dimension. This string is for debugging purpose only and may change in future version. The default implementation format the sample value range, then the list of categories. A "*" mark is put in front of what seems the "main" category.



wrap
public static GridSampleDimension wrap(SampleDimension sd)(Code)
Wrap the specified OpenGIS's sample dimension into a Geotools's implementation of GridSampleDimension .
Parameters:
  sd - The sample dimension to wrap into a Geotools implementation.



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.