org.geotools.gce.imagepyramid
Class ImagePyramidReader

java.lang.Object
  extended by org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
      extended by org.geotools.gce.imagepyramid.ImagePyramidReader
All Implemented Interfaces:
org.opengis.coverage.grid.GridCoverageReader

public final class ImagePyramidReader
extends AbstractGridCoverage2DReader
implements org.opengis.coverage.grid.GridCoverageReader

This reader is repsonsible for providing access to a pyramid of mosaics of georeferenced coverages that are read directly through imageio readers, like tiff, pngs, etc...

Specifically this plugin relies on the image mosaic plugin to handle each single level of resolutions avaible, hence all the magic is done inside the mosaic plugin.

For information on how to build a mosaic, please refere to the ImageMosaicReader documentation.

If you are looking for information on how to create a pyramid, here you go. The pyramid itself does no magic. All the magic is performed by the single mosaic readers that are polled depending on the requeste resolution levels. Therefore the first step is having a mosaic of images like geotiff, tiff, jpeg, or png which is going to be the base for te pyramid.

The second step is to build the next (lower resolution) levels for the pyramid.
If you look inside the spike dire of the geotools project you will find a (growing) set of tools that can be used for doing processing on coverages.
Specifically there is one tool called PyramidBuilder that can be used to build the pyramid level by level.

Last step is providing a prj file with the projection of the pyramid (btw all the levels has to be in the same projection) as well as a properties file with this structure:

           #
           #Mon Aug 21 22:23:27 CEST 2006
           #name of the coverage
           Name=ikonos
           #different resolution levels available
           Levels=1.2218682749859724E-5,9.220132503102996E-6 2.4428817977683634E-5,1.844026500620314E-5 4.8840552865873626E-5,3.686350299024973E-5 9.781791400307775E-5,7.372700598049946E-5 1.956358280061555E-4,1.4786360643866836E-4 3.901787184256844E-4,2.9572721287731037E-4
           #where all the levels reside
           LevelsDirs=0 2 4 8 16 32
           #number of levels availaible
           LevelsNum=6
           #envelope for this pyramid
           Envelope2D=13.398228477973406,43.591366397808976 13.537912459169803,43.67121274528585
 

Since:
2.3
Author:
Simone Giannecchini, Stefan Alfons Krueger (alfonx), Wikisquare.de : Support for jar:file:foo.jar/bar.properties like URLs

Field Summary
 
Fields inherited from class org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
closeMe, coverageFactory, coverageName, crs, demColors, EPS, gzipped, highestRes, hints, inStream, numOverviews, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, source
 
Constructor Summary
ImagePyramidReader(java.lang.Object source)
          Constructor for an ImagePyramidReader.
ImagePyramidReader(java.lang.Object source, Hints uHints)
          Constructor for an ImagePyramidReader.
 
Method Summary
 void dispose()
          Disposes this reader.
 org.opengis.coverage.grid.Format getFormat()
           
 int getGridCoverageCount()
          Number of coverages for this reader is 1
 GridCoverage2D read(org.opengis.parameter.GeneralParameterValue[] params)
          Read the current grid coverage from the stream.
 
Methods inherited from class org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
createImageCoverage, createImageCoverage, decimationOnReadingControl, finalize, getCrs, getCurrentSubname, getInfo, getMetadataNames, getMetadataValue, getOriginalEnvelope, getOriginalGridRange, getOriginalGridToWorld, getResolution, getSource, hasMoreGridCoverages, listSubNames, setReadParams, skip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opengis.coverage.grid.GridCoverageReader
getCurrentSubname, getMetadataNames, getMetadataValue, getSource, hasMoreGridCoverages, listSubNames, skip
 

Constructor Detail

ImagePyramidReader

public ImagePyramidReader(java.lang.Object source,
                          Hints uHints)
                   throws java.io.IOException
Constructor for an ImagePyramidReader.

Parameters:
source - The source object.
uHints - Hints to control the behaviour of this reader.
Throws:
java.io.IOException
java.io.UnsupportedEncodingException

ImagePyramidReader

public ImagePyramidReader(java.lang.Object source)
                   throws java.io.IOException
Constructor for an ImagePyramidReader.

Parameters:
source - The source object.
Throws:
java.io.IOException
java.io.UnsupportedEncodingException
Method Detail

getFormat

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

read

public GridCoverage2D read(org.opengis.parameter.GeneralParameterValue[] params)
                    throws java.io.IOException
Description copied from class: AbstractGridCoverage2DReader
Read the current grid coverage from the stream.

Example:


 
The method AbstractGridCoverage2DReader.hasMoreGridCoverages() should be invoked first in order to verify that a coverage is available.

Specified by:
read in interface org.opengis.coverage.grid.GridCoverageReader
Specified by:
read in class AbstractGridCoverage2DReader
Parameters:
params - Optional parameters matching Format.getReadParameters().
Returns:
a grid coverage from the input source.
Throws:
java.io.IOException - if a read operation failed for some other input/output reason, including FileNotFoundException if no file with the given name can be found, or IIOException if an error was thrown by the underlying image library.

dispose

public void dispose()
Description copied from class: AbstractGridCoverage2DReader
Disposes this reader.

This method just tries to close the underlying ImageInputStream.

Specified by:
dispose in interface org.opengis.coverage.grid.GridCoverageReader
Overrides:
dispose in class AbstractGridCoverage2DReader
See Also:
GridCoverageReader.dispose()

getGridCoverageCount

public int getGridCoverageCount()
Number of coverages for this reader is 1

Overrides:
getGridCoverageCount in class AbstractGridCoverage2DReader
Returns:
the number of coverages for this reader.
See Also:
org.opengis.coverage.grid.GridCoverageReader#getGridCoverageCount()


Copyright © 1996-2010 Geotools. All Rights Reserved.