Java Doc for NetcdfImageReader.java in  » GIS » GeoTools-2.4.1 » org » geotools » image » io » netcdf » 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.image.io.netcdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.image.io.FileImageReader
   org.geotools.image.io.netcdf.NetcdfImageReader

NetcdfImageReader
public class NetcdfImageReader extends FileImageReader implements CancelTask(Code)
Base implementation for NetCDF image reader. Pixels are assumed organized according the COARDS convention (a precursor of CF Metadata conventions), i.e. in (t,z,y,x) order, where x varies faster. The image is created from the two last dimensions (x,y). Additional dimensions (if any) are handled as below in the default implementation:

Example:
Assuming that:

  • None of the above methods has been invoked
  • Axis are (t,z,y,x)
Then the users can select the z value using ImageReadParam.setSourceBands . If no band is selected, then the default selection is the first band (0) only. Note that this is different than the usual Image I/O default, which is all bands.

Connection to DODS servers This image reader accepts File and URL inputs. In the later case, if and only if the URL uses the DODS protocol (as in " dods://opendap.aviso.oceanobs.com/ "), then this image reader tries to connect to the DODS remote server. Otherwise the URL content is copied in a temporary file.
since:
   2.4
version:
   $Id: NetcdfImageReader.java 27762 2007-11-05 21:11:12Z desruisseaux $
author:
   Antoine Hnawia
author:
   Martin Desruisseaux


Inner Class :public static class Spi extends FileImageReader.Spi

Field Summary
protected  Variablevariable
     The data from the NetCDF file.

Constructor Summary
public  NetcdfImageReader(Spi spi)
     Constructs a new NetCDF reader.

Method Summary
protected  voidclose()
     Closes the NetCDF file.
protected  IIOMetadatacreateMetadata(NetcdfDataset file)
     Creates metadata for the specified NetCDF file.
protected  IIOMetadatacreateMetadata(VariableDS variable)
     Creates metadata for the specified NetCDF variable.
protected  VariablefindVariable(String name)
     Returns the variable of the given name.
public  ImageReadParamgetDefaultReadParam()
     Returns parameters initialized with default values appropriate for this format.
public  intgetHeight(int imageIndex)
     Returns the image height.
public  IIOMetadatagetImageMetadata(int imageIndex)
     Returns the metadata associated with the image at the specified index.
public  intgetNumImages(boolean allowSearch)
     Returns the number of images available from the current input source.
protected  intgetRawDataType(int imageIndex)
     Returns the data type which most closely represents the "raw" internal data of the image.
Parameters:
  imageIndex - The index of the image to be queried.
public  StatisticsgetStatistics(int imageIndex)
     Returns statistics about the sample values in the specified image.
public  IIOMetadatagetStreamMetadata()
     Returns the metadata associated with the input source as a whole.
public  String[]getVariables()
     Returns the names of the variables to be read.
public  intgetWidth(int imageIndex)
     Returns the image width.
public  booleanisCancel()
     Invoked by the NetCDF library during read operation in order to check if the task has been canceled.
protected  booleanprepareVariable(int imageIndex)
     Ensures that data are loaded in the NetCDF .
public  BufferedImageread(int imageIndex, ImageReadParam param)
     Creates an image from the specified parameters.
public  voidsetError(String message)
     Invoked by the NetCDF library when an error occured during the read operation.
public  voidsetVariables(String[] variableNames)
     Sets the name of the to be read in a NetCDF file.

Field Detail
variable
protected Variable variable(Code)
The data from the NetCDF file. The value for this field is set by NetcdfImageReader.prepareVariable when first needed. This is typically (but not necessarly) an instance of VariableDS .




Constructor Detail
NetcdfImageReader
public NetcdfImageReader(Spi spi)(Code)
Constructs a new NetCDF reader.
Parameters:
  spi - The service provider.




Method Detail
close
protected void close() throws IOException(Code)
Closes the NetCDF file.



createMetadata
protected IIOMetadata createMetadata(NetcdfDataset file) throws IOException(Code)
Creates metadata for the specified NetCDF file. This method is invoked automatically by NetcdfImageReader.getStreamMetadata when first needed. The default implementation returns an instance of NetcdfMetadata . Subclasses can override this method in order to create a more specific set of metadata.



createMetadata
protected IIOMetadata createMetadata(VariableDS variable) throws IOException(Code)
Creates metadata for the specified NetCDF variable. This method is invoked automatically by NetcdfImageReader.getImageMetadata when first needed. The default implementation returns an instance of NetcdfMetadata . Subclasses can override this method in order to create a more specific set of metadata.



findVariable
protected Variable findVariable(String name) throws IOException(Code)
Returns the variable of the given name. This method is similar to NetcdfDataset.findVariable(String) except that the search is case-insensitive and an exception is thrown if no variable has been found for the given name.
Parameters:
  name - The name of the variable to search. The variable for the given name.
throws:
  IIOException - if no variable has been found for the given name.
throws:
  IOException - If the operation failed because of an I/O error.



getDefaultReadParam
public ImageReadParam getDefaultReadParam()(Code)
Returns parameters initialized with default values appropriate for this format. Parameters which may be used to control the decoding process using a setof default settings.



getHeight
public int getHeight(int imageIndex) throws IOException(Code)
Returns the image height.



getImageMetadata
public IIOMetadata getImageMetadata(int imageIndex) throws IOException(Code)
Returns the metadata associated with the image at the specified index.



getNumImages
public int getNumImages(boolean allowSearch) throws IllegalStateException, IOException(Code)
Returns the number of images available from the current input source.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IOException - if an error occurs reading the information from the input source.



getRawDataType
protected int getRawDataType(int imageIndex) throws IOException(Code)
Returns the data type which most closely represents the "raw" internal data of the image.
Parameters:
  imageIndex - The index of the image to be queried. The data type, or DataBuffer.TYPE_UNDEFINED if unknown.
throws:
  IOException - If an error occurs reading the format information from the input source.



getStatistics
public Statistics getStatistics(int imageIndex) throws IOException(Code)
Returns statistics about the sample values in the specified image. This is for informative purpose only and may be used when the do not provides useful information about valid minimum and maximum values. Note that this method requires a full scan of image data and may be slow.
Parameters:
  imageIndex - The index of the image to analyze. Statistics on the sample values in the given image.
throws:
  IOException - if an I/O error occured while reading the sample values.



getStreamMetadata
public IIOMetadata getStreamMetadata() throws IOException(Code)
Returns the metadata associated with the input source as a whole.



getVariables
public String[] getVariables() throws IOException(Code)
Returns the names of the variables to be read. The first name is assigned to image index 0, the second name to image index 1, etc.. In other words a call to (imageIndex) will read the variable names variables[imageIndex] where variables is the value returned by this method.

The sequence of variable to be read can be changed by a call to NetcdfImageReader.setVariables . The name of the variables to be read.
throws:
  IOException - if the NetCDF file can not be read.




getWidth
public int getWidth(int imageIndex) throws IOException(Code)
Returns the image width.



isCancel
public boolean isCancel()(Code)
Invoked by the NetCDF library during read operation in order to check if the task has been canceled. Users should not invoke this method directly.



prepareVariable
protected boolean prepareVariable(int imageIndex) throws IOException(Code)
Ensures that data are loaded in the NetCDF . If data are already loaded, then this method do nothing.

This method is invoked automatically before any operation that require the NetCDF variable, including (but not limited to):


Parameters:
  imageIndex - The image index. true if the changed as a result of this call,or false if the current value is already appropriate.
throws:
  IndexOutOfBoundsException - if the specified index is outside the expected range.
throws:
  IllegalStateException - If NetcdfImageReader.input is not set.
throws:
  IOException - If the operation failed because of an I/O error.



read
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException(Code)
Creates an image from the specified parameters.



setError
public void setError(String message)(Code)
Invoked by the NetCDF library when an error occured during the read operation. Users should not invoke this method directly.



setVariables
public void setVariables(String[] variableNames)(Code)
Sets the name of the to be read in a NetCDF file. The first name is assigned to image index 0, the second name to image index 1, etc..

If variableNames is set to null (which is the default), then the variables will be inferred from the content of the NetCDF file.




Methods inherited from org.geotools.image.io.FileImageReader
protected void close() throws IOException(Code)(Java Doc)
protected File getInputFile() throws IOException(Code)(Java Doc)
public String getURLEncoding()(Code)(Java Doc)
public boolean isRandomAccessEasy(int imageIndex) throws IOException(Code)(Java Doc)
protected boolean isTemporaryFile()(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.