deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.coverage.grid
Class WorldFile

java.lang.Object
  extended by org.deegree.model.coverage.grid.WorldFile

public class WorldFile
extends Object

class representation of a ESRI world file. A world file may defines bounding coordinates centered on the outter pixel (e.g. ESRI software) or outside the bounding pixels (e.g.Oracle spatial). Reading a worldfile this must be considered so the type of a worldfile must be passed. For this a enum named TYPE ist defined.

Version:
$Revision: 9343 $, $Revision: 9343 $, $Date: 2007-12-27 14:30:32 +0100 (Do, 27 Dez 2007) $
Author:
Andreas Poth, last edited by: $Author: apoth $

Nested Class Summary
static class WorldFile.TYPE
          TYPE enumerates the world file types.
 
Constructor Summary
WorldFile(double resx, double resy, double rotation1, double rotation2, Envelope envelope)
           
 
Method Summary
 Envelope getEnvelope()
          returns the envelope described by a word file
 double getResx()
          returns the x-resolution described by a word file
 double getResy()
          returns the y-resolution described by a word file
 double getRotation1()
          returns the first rotation described by a word file
 double getRotation2()
          returns the second rotation described by a word file
static boolean hasWorldfileSuffix(String name)
           
static WorldFile readWorldFile(String filename, WorldFile.TYPE type)
           
static WorldFile readWorldFile(String filename, WorldFile.TYPE type, BufferedImage image)
          returns a class represention of a ESRI world file
static WorldFile readWorldFile(String filename, WorldFile.TYPE type, int width, int height)
           
 String toString()
           
static void writeWorldFile(WorldFile wf, String fileBaseName)
          writes a WorldFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorldFile

public WorldFile(double resx,
                 double resy,
                 double rotation1,
                 double rotation2,
                 Envelope envelope)
Parameters:
resx - resolution x-direction
resy - resolution y-direction (negative value)
rotation1 - first rotation parameter
rotation2 - second rotation parameter
envelope - the envelope of the worldfile
Method Detail

readWorldFile

public static WorldFile readWorldFile(String filename,
                                      WorldFile.TYPE type)
                               throws IOException
Parameters:
filename - name of the image/raster file inclusing path and extension
type -
Returns:
a class represention of a ESRI world file
Throws:
IOException

hasWorldfileSuffix

public static boolean hasWorldfileSuffix(String name)
Parameters:
name -
Returns:
true, if the name ends with .tfw, .wld, .jgw, .gfw, .gifw, .pgw or .pngw.

readWorldFile

public static WorldFile readWorldFile(String filename,
                                      WorldFile.TYPE type,
                                      int width,
                                      int height)
                               throws IOException
Parameters:
filename - name of the image/raster file inclusing path and extension
type -
width - image width in pixel
height - image height in pixel
Returns:
a class represention of a ESRI world file
Throws:
IOException

readWorldFile

public static WorldFile readWorldFile(String filename,
                                      WorldFile.TYPE type,
                                      BufferedImage image)
                               throws IOException
returns a class represention of a ESRI world file

Parameters:
filename - name of the image/raster file inclusing path and extension
type - world file type
image - image/raster the worldfile belongs too
Returns:
a class represention of a ESRI world file
Throws:
IOException

writeWorldFile

public static void writeWorldFile(WorldFile wf,
                                  String fileBaseName)
                           throws IOException
writes a WorldFile

Parameters:
wf -
fileBaseName -
Throws:
IOException

getEnvelope

public Envelope getEnvelope()
returns the envelope described by a word file

Returns:
the envelope described by a word file

getResx

public double getResx()
returns the x-resolution described by a word file

Returns:
the x-resolution described by a word file

getResy

public double getResy()
returns the y-resolution described by a word file

Returns:
the y-resolution described by a word file

getRotation1

public double getRotation1()
returns the first rotation described by a word file

Returns:
the first rotation described by a word file

getRotation2

public double getRotation2()
returns the second rotation described by a word file

Returns:
the second rotation described by a word file

toString

public String toString()
Overrides:
toString in class Object

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net