org.deegree.coverage.raster.io.grid
Class GridMetaInfoFile

java.lang.Object
  extended by org.deegree.coverage.raster.io.grid.GridMetaInfoFile
Direct Known Subclasses:
CacheInfoFile

public class GridMetaInfoFile
extends Object

The GridMetaInfoFile encapsulates the values of the extended worldfile needed to understand blobs of the GriddedBlobTileContainer

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
protected  Envelope envelope
           
static String METAINFO_FILE
          defined rasterio options name of the index file.
static String METAINFO_FILE_NAME
          standard name of the index file.
 
Constructor Summary
GridMetaInfoFile(RasterGeoReference geoReference, int rows, int columns, int tileRasterWidth, int tileRasterHeight, int bands, DataType dataType)
           
GridMetaInfoFile(RasterGeoReference geoReference, int rows, int columns, int tileRasterWidth, int tileRasterHeight, RasterDataInfo dataInfo)
           
 
Method Summary
 int columns()
           
static File fileNameFromOptions(String defaultDir, String filename, RasterIOOptions options)
          find a filename from the given options or create a 'default-file-name' in the given directory.
 RasterDataInfo getDataInfo()
           
 Envelope getEnvelope(RasterGeoReference.OriginLocation location)
           
 RasterGeoReference getGeoReference()
           
 int getTileRasterHeight()
           
 int getTileRasterWidth()
           
static GridMetaInfoFile read(BufferedReader readerOnInfoFile, RasterIOOptions options)
          Read the grid info file which is basically a world file with supplement information.
static GridMetaInfoFile readFromFile(File infoFile, RasterIOOptions options)
          Read the grid info file which is basically a world file with supplement information.
 int rows()
           
 void setEnvelope(Envelope envelope)
          Set the envelope
static void write(PrintWriter writer, GridMetaInfoFile metaInfo, RasterIOOptions options)
          Write the grid info file which is basically a world file with supplement information.
static void writeToFile(File filename, GridMetaInfoFile metaInfo, RasterIOOptions options)
          Write the grid info file which is basically a world file with supplement information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METAINFO_FILE

public static final String METAINFO_FILE
defined rasterio options name of the index file.

See Also:
Constant Field Values

METAINFO_FILE_NAME

public static final String METAINFO_FILE_NAME
standard name of the index file.

See Also:
Constant Field Values

envelope

protected Envelope envelope
Constructor Detail

GridMetaInfoFile

public GridMetaInfoFile(RasterGeoReference geoReference,
                        int rows,
                        int columns,
                        int tileRasterWidth,
                        int tileRasterHeight,
                        int bands,
                        DataType dataType)
Parameters:
geoReference -
rows -
columns -
tileRasterWidth -
tileRasterHeight -
bands -
dataType -

GridMetaInfoFile

public GridMetaInfoFile(RasterGeoReference geoReference,
                        int rows,
                        int columns,
                        int tileRasterWidth,
                        int tileRasterHeight,
                        RasterDataInfo dataInfo)
Parameters:
geoReference -
rows -
columns -
tileRasterWidth -
tileRasterHeight -
dataInfo -
Method Detail

readFromFile

public static GridMetaInfoFile readFromFile(File infoFile,
                                            RasterIOOptions options)
                                     throws NumberFormatException,
                                            IOException
Read the grid info file which is basically a world file with supplement information.

Parameters:
infoFile - to read.
options - containing information about the crs, origin location etc.
Returns:
an new GridMetaInfoFile read from the given file.
Throws:
NumberFormatException
IOException

read

public static GridMetaInfoFile read(BufferedReader readerOnInfoFile,
                                    RasterIOOptions options)
                             throws NumberFormatException,
                                    IOException
Read the grid info file which is basically a world file with supplement information.

Parameters:
readerOnInfoFile - to read the data from.
options - containing information about the crs, origin location etc.
Returns:
an new GridMetaInfoFile read from the given file.
Throws:
NumberFormatException
IOException

writeToFile

public static void writeToFile(File filename,
                               GridMetaInfoFile metaInfo,
                               RasterIOOptions options)
                        throws IOException
Write the grid info file which is basically a world file with supplement information.

Parameters:
filename - to write to.
metaInfo - to write.
options - containing information about the crs, origin location etc.
Throws:
NumberFormatException
IOException

write

public static void write(PrintWriter writer,
                         GridMetaInfoFile metaInfo,
                         RasterIOOptions options)
                  throws IOException
Write the grid info file which is basically a world file with supplement information.

Parameters:
writer - to write to.
metaInfo - to write.
options - containing information about the crs, origin location etc.
Throws:
NumberFormatException
IOException

fileNameFromOptions

public static File fileNameFromOptions(String defaultDir,
                                       String filename,
                                       RasterIOOptions options)
find a filename from the given options or create a 'default-file-name' in the given directory.

Parameters:
defaultDir - to use if the options do not contain a file, a file named gridded_raster.info METAINFO_FILE_NAME will be created.
filename - if no name could be read from the options, use the given filename.
options - to get the file for the given grid meta info.
Returns:
a file defined by the given options or the default filename in the given directory.

getGeoReference

public final RasterGeoReference getGeoReference()
Returns:
the geoReference

getTileRasterWidth

public final int getTileRasterWidth()
Returns:
the width of the raster of a single tile

getTileRasterHeight

public final int getTileRasterHeight()
Returns:
the height of the raster of a single tile

rows

public final int rows()
Returns:
the number of tiles in the height (rows) of the grid file.

columns

public final int columns()
Returns:
the number of tiles in the width (columns) of the grid file.

getEnvelope

public Envelope getEnvelope(RasterGeoReference.OriginLocation location)
Parameters:
location - of the origin for which the resulting envelope should be calculated.
Returns:
an envelope based on the number of columns/rows in the grid file and the number of tile samples.

setEnvelope

public void setEnvelope(Envelope envelope)
Set the envelope

Parameters:
envelope -

getDataInfo

public final RasterDataInfo getDataInfo()
Returns:
the data info


Copyright © 2011. All Rights Reserved.