org.geotools.gce.geotiff
Class GeoTiffReader

java.lang.Object
  extended byorg.geotools.gce.geotiff.GeoTiffReader
All Implemented Interfaces:
org.opengis.coverage.grid.GridCoverageReader

public class GeoTiffReader
extends java.lang.Object
implements org.opengis.coverage.grid.GridCoverageReader

GeoTiffReader is responsible for exposing the data and the Georeferencing metadata available to the Geotools library.

Author:
Bryce Nordgren, USDA Forest Service

Constructor Summary
GeoTiffReader(org.opengis.coverage.grid.Format creater, java.lang.Object source, Hints hints)
          Creates a new instance of GeoTiffReader
 
Method Summary
 void dispose()
           
 java.lang.String getCurrentSubname()
          No subnames.
 org.opengis.coverage.grid.Format getFormat()
           
 java.lang.String[] getMetadataNames()
           
 java.lang.String getMetadataValue(java.lang.String name)
           
 java.lang.Object getSource()
           
 boolean hasMoreGridCoverages()
          Returns true if another image remains to be read.
static boolean isGeoTiffFile(java.io.File file)
          Static method checks the given file to ensure that: It's a TIFF file.
 java.lang.String[] listSubNames()
          Always returns null.
 org.opengis.coverage.grid.GridCoverage read(org.opengis.parameter.GeneralParameterValue[] params)
          This method reads in the TIFF image, constructs an appropriate CRS, determines the math transform from raster to the CRS model, and constructs a GridCoverage.
 void skip()
          There are no guts to this function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTiffReader

public GeoTiffReader(org.opengis.coverage.grid.Format creater,
                     java.lang.Object source,
                     Hints hints)
Creates a new instance of GeoTiffReader

Parameters:
creater - format object creating this reader
source - the GeoTiff file
hints - user-supplied hints
Method Detail

isGeoTiffFile

public static boolean isGeoTiffFile(java.io.File file)
Static method checks the given file to ensure that:

Parameters:
file - The file to check
Returns:
TRUE if the file is a GeoTiff file.

dispose

public void dispose()
Specified by:
dispose in interface org.opengis.coverage.grid.GridCoverageReader

getCurrentSubname

public java.lang.String getCurrentSubname()
No subnames. Always returns null.

Specified by:
getCurrentSubname in interface org.opengis.coverage.grid.GridCoverageReader
Returns:
null

getFormat

public org.opengis.coverage.grid.Format getFormat()
Specified by:
getFormat in interface org.opengis.coverage.grid.GridCoverageReader

getMetadataNames

public java.lang.String[] getMetadataNames()
                                    throws java.io.IOException
Specified by:
getMetadataNames in interface org.opengis.coverage.grid.GridCoverageReader
Throws:
java.io.IOException

getMetadataValue

public java.lang.String getMetadataValue(java.lang.String name)
                                  throws java.io.IOException,
                                         org.opengis.coverage.MetadataNameNotFoundException
Specified by:
getMetadataValue in interface org.opengis.coverage.grid.GridCoverageReader
Throws:
java.io.IOException
org.opengis.coverage.MetadataNameNotFoundException

getSource

public java.lang.Object getSource()
Specified by:
getSource in interface org.opengis.coverage.grid.GridCoverageReader

hasMoreGridCoverages

public boolean hasMoreGridCoverages()
Returns true if another image remains to be read. This module currently only supports one image per TIFF file, so the first read will make this method return false.

Specified by:
hasMoreGridCoverages in interface org.opengis.coverage.grid.GridCoverageReader
Returns:
true if another grid coverage remains to be read.

listSubNames

public java.lang.String[] listSubNames()
Always returns null. No subnames.

Specified by:
listSubNames in interface org.opengis.coverage.grid.GridCoverageReader
Returns:
null

read

public org.opengis.coverage.grid.GridCoverage read(org.opengis.parameter.GeneralParameterValue[] params)
                                            throws java.io.IOException
This method reads in the TIFF image, constructs an appropriate CRS, determines the math transform from raster to the CRS model, and constructs a GridCoverage.

Specified by:
read in interface org.opengis.coverage.grid.GridCoverageReader
Parameters:
params - currently ignored, potentially may be used for hints.
Returns:
grid coverage represented by the image
Throws:
java.io.IOException - on any IO related troubles

skip

public void skip()
There are no guts to this function. Only single-image TIFF files are supported.

Specified by:
skip in interface org.opengis.coverage.grid.GridCoverageReader
Throws:
java.lang.UnsupportedOperationException - always


Copyright © GeoTools. All Rights Reserved.