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


java.lang.Object
   org.geotools.coverage.io.AbstractGridCoverageReader

All known Subclasses:   org.geotools.coverage.io.ExoreferencedGridCoverageReader,
AbstractGridCoverageReader
abstract public class AbstractGridCoverageReader implements GridCoverageReader(Code)
Base class for reading GridCoverage objects. Reading is a two steps process: The input file must be set first, then the actual reading is performed with the AbstractGridCoverageReader.getGridCoverage . Example:
 AbstractGridCoverageReader reader = ...
 reader.
 (new File("MyCoverage.dat"), true);
 GridCoverage coverage = reader.
 (0);
 
Subclasses needs to implements at least the following methods: The default implementation should be able to create acceptable grid coverage using informations provided by the two above-mentioned methods. However, other methods may be overriden too in order to get finner control on the result.
since:
   2.2
version:
   $Id: AbstractGridCoverageReader.java 27862 2007-11-12 19:51:19Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
static  LoggerLOGGER
     The logger for the AbstractGridCoverageReader.getGridCoverage method.
final protected  GridToEnvelopeMappergridToEnvelope
     The object to use for creating from the and the .
protected  ImageReaderreader
     The ImageReader to use for decoding RenderedImage s.

Constructor Summary
public  AbstractGridCoverageReader(Hints hints)
     Constructs a AbstractGridCoverageReader .
public  AbstractGridCoverageReader(Hints hints, String formatName)
     Constructs a AbstractGridCoverageReader for the specified format name.

Method Summary
final  intcheckImageIndex(int imageIndex)
     Ensures that the specified image index in inside the expected range.
abstract public  CoordinateReferenceSystemgetCoordinateReferenceSystem(int index)
     Returns the coordinate reference system for the GridCoverage to be read.
Parameters:
  index - The index of the image to be queried.
abstract public  EnvelopegetEnvelope(int index)
     Returns the envelope for the GridCoverage to be read. The envelope must have the same number of dimensions than the coordinate reference system.
Parameters:
  index - The index of the image to be queried.
public synchronized  GridCoveragegetGridCoverage(int index)
     Reads the grid coverage.
public synchronized  GridRangegetGridRange(int index)
     Returns the grid range for the GridCoverage to be read. The grid range must have the same number of dimensions than the envelope. The default implementation construct a GridRange object using information provided by ImageReader.getWidth and ImageReader.getHeight .
Parameters:
  index - The index of the image to be queried.
protected  IteratorgetImageReaders(Object input)
     Returns an Iterator containing all currently registered ImageReader s that claim to be able to decode the image.
public  LocalegetLocale()
     Returns the currently set Locale , or null if none has been set.
public synchronized  MathTransformgetMathTransform(int index)
     Returns the transform from to coordinates.
public synchronized  StringgetName(int index)
     Gets the GridCoverage name at the specified index.
public synchronized  intgetNumImages(boolean allowSearch)
     Returns the number of images available from the current input source. Note that some image formats do not specify how many images are present in the stream.
public synchronized  GridSampleDimension[]getSampleDimensions(int index)
     Returns the sample dimensions for each band of the GridCoverage to be read.
final  StringgetString(int key)
     Returns a localized string for the specified error key.
public synchronized  voidreset()
     Restores the AbstractGridCoverageReader to its initial state.
public synchronized  voidsetInput(Object input, boolean seekForwardOnly)
     Sets the input source to the given object.
public synchronized  voidsetLocale(Locale locale)
     Sets the current of this coverage reader to the given value.

Field Detail
LOGGER
static Logger LOGGER(Code)
The logger for the AbstractGridCoverageReader.getGridCoverage method.



gridToEnvelope
final protected GridToEnvelopeMapper gridToEnvelope(Code)
The object to use for creating from the and the . Subclasses can change its configuration after AbstractGridCoverageReader construction in order to change its behavior regarding axis reversal or axis swapping for example.
See Also:   AbstractGridCoverageReader.getMathTransform
since:
   2.4



reader
protected ImageReader reader(Code)
The ImageReader to use for decoding RenderedImage s. This reader is initially null and lazily created the first time AbstractGridCoverageReader.setInput is invoked. Once created, it is reused as much as possible. Invoking AbstractGridCoverageReader.reset dispose the reader and set it back to null .




Constructor Detail
AbstractGridCoverageReader
public AbstractGridCoverageReader(Hints hints)(Code)
Constructs a AbstractGridCoverageReader . The will be determined from the file extension, if any.
Parameters:
  hints - The factory hints to use.
since:
   2.4



AbstractGridCoverageReader
public AbstractGridCoverageReader(Hints hints, String formatName)(Code)
Constructs a AbstractGridCoverageReader for the specified format name. This format name should be known to ImageIO.getImageReadersByFormatName(String) .
Parameters:
  hints - The factory hints to use.
Parameters:
  formatName - The format name of the to use,or null for relying on file extension instead.
since:
   2.4




Method Detail
checkImageIndex
final int checkImageIndex(int imageIndex) throws IOException, IndexOutOfBoundsException(Code)
Ensures that the specified image index in inside the expected range. The upper limit (exclusive) is given by AbstractGridCoverageReader.getNumImages getNumImages (false).
Parameters:
  imageIndex - The index to check for validity. The numImages value, as an opportunist information.
throws:
  IndexOutOfBoundsException - If the index is invalid.
throws:
  IOException - If an error occurs reading the information from the input source.



getCoordinateReferenceSystem
abstract public CoordinateReferenceSystem getCoordinateReferenceSystem(int index) throws IOException(Code)
Returns the coordinate reference system for the GridCoverage to be read.
Parameters:
  index - The index of the image to be queried. The coordinate reference system for the GridCoverage at the specified index.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the width information from the input source.



getEnvelope
abstract public Envelope getEnvelope(int index) throws IOException(Code)
Returns the envelope for the GridCoverage to be read. The envelope must have the same number of dimensions than the coordinate reference system.
Parameters:
  index - The index of the image to be queried. The envelope for the GridCoverage at the specified index.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the width information from the input source.



getGridCoverage
public synchronized GridCoverage getGridCoverage(int index) throws IOException(Code)
Reads the grid coverage. The default implementation gets the default ImageReadParam and checks if it is an instance of RawBinaryImageReadParam . If it is, this method then invokes RawBinaryImageReadParam.setStreamImageSize with informations provided by AbstractGridCoverageReader.getGridRange . Finally, a grid coverage is constructed using informations provided by AbstractGridCoverageReader.getName , AbstractGridCoverageReader.getCoordinateReferenceSystem and AbstractGridCoverageReader.getEnvelope .
Parameters:
  index - The index of the image to be queried. The GridCoverage at the specified index.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the width information from the input source.



getGridRange
public synchronized GridRange getGridRange(int index) throws IOException(Code)
Returns the grid range for the GridCoverage to be read. The grid range must have the same number of dimensions than the envelope. The default implementation construct a GridRange object using information provided by ImageReader.getWidth and ImageReader.getHeight .
Parameters:
  index - The index of the image to be queried. The grid range for the GridCoverage at the specified index.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the width information from the input source.



getImageReaders
protected Iterator getImageReaders(Object input)(Code)
Returns an Iterator containing all currently registered ImageReader s that claim to be able to decode the image. The default implementation returns ImageIO.getImageReadersByFormatName( AbstractGridCoverageReader.formatName ).
Parameters:
  input - The input source.



getLocale
public Locale getLocale()(Code)
Returns the currently set Locale , or null if none has been set.



getMathTransform
public synchronized MathTransform getMathTransform(int index) throws IOException(Code)
Returns the transform from to coordinates. The default implementation uses the AbstractGridCoverageReader.gridToEnvelope mapper.
since:
   2.4



getName
public synchronized String getName(int index) throws IOException(Code)
Gets the GridCoverage name at the specified index. The default implementation returns the input filename, or the "Untitled" string if input is not a File or an URL object.
Parameters:
  index - The index of the image to be queried. The name for the GridCoverage at the specified index.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the information from the input source.



getNumImages
public synchronized int getNumImages(boolean allowSearch) throws IOException(Code)
Returns the number of images available from the current input source. Note that some image formats do not specify how many images are present in the stream. Thus determining the number of images will require the entire stream to be scanned and may require memory for buffering. The allowSearch parameter may be set to false to indicate that an exhaustive search is not desired.
Parameters:
  allowSearch - If true , the true number of images willbe returned even if a search is required. If false ,the reader may return -1 without performing the search. The number of images, or -1 if allowSearch is false and a search would be required.
throws:
  IllegalStateException - If the input source has not been set, or ifthe input has been specified with seekForwardOnly set to true .
throws:
  IOException - If an error occurs reading the information from the input source.



getSampleDimensions
public synchronized GridSampleDimension[] getSampleDimensions(int index) throws IOException(Code)
Returns the sample dimensions for each band of the GridCoverage to be read. If sample dimensions are not known, then this method returns null . The default implementation always returns null .
Parameters:
  index - The index of the image to be queried. The category lists for the GridCoverage at the specified index.This array's length must be equals to the number of bands in GridCoverage.
throws:
  IllegalStateException - if the input source has not been set.
throws:
  IndexOutOfBoundsException - if the supplied index is out of bounds.
throws:
  IOException - if an error occurs reading the width information from the input source.



getString
final String getString(int key)(Code)
Returns a localized string for the specified error key.



reset
public synchronized void reset() throws IOException(Code)
Restores the AbstractGridCoverageReader to its initial state.
throws:
  IOException - if an error occurs while disposing resources.



setInput
public synchronized void setInput(Object input, boolean seekForwardOnly) throws IOException(Code)
Sets the input source to the given object. The input is usually a File or an URL object. But some other types (e.g. ImageInputStream ) may be accepted too.

If this method is invoked for the first time or after a call to AbstractGridCoverageReader.reset , then it will queries AbstractGridCoverageReader.getImageReaders for a list of ImageReader s and select the first one that accept the input.
Parameters:
  input - The File or URL to be read.
Parameters:
  seekForwardOnly - if true , grid coveragesand metadata may only be read in ascending order fromthe input source.
throws:
  IOException - if an I/O operation failed.
throws:
  IllegalArgumentException - if input is not an instanceof one of the classes declared by the ImageReaderservice provider.




setLocale
public synchronized void setLocale(Locale locale)(Code)
Sets the current of this coverage reader to the given value. A value of null removes any previous setting, and indicates that the reader should localize as it sees fit.



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.