org.deegree.coverage.raster.io.xyz
Class XYZReader

java.lang.Object
  extended by org.deegree.coverage.raster.io.xyz.XYZReader
All Implemented Interfaces:
RasterReader

public class XYZReader
extends Object
implements RasterReader

This class implements a simple reader for text raster files. The text file should contain lines with whitespace-delimited x y z/value coordinates. The coordinates should be integer or float values as ascii text.

Version:
$Revision:10872 $, $Date:2008-04-01 15:41:48 +0200 (Tue, 01 Apr 2008) $
Author:
Oliver Tonnhofer, last edited by: $Author:otonnhofer $

Constructor Summary
XYZReader()
           
 
Method Summary
 boolean canLoad(File filename)
          Check if the raster reader is able to read the given raster file.
 boolean canReadTiles()
          should return true if the given reader can easily read tiles,without consuming much more memory than needed.
 void dispose()
          Signals the reader that it should try to dispose all in memory data.
 File file()
           
 String getDataLocationId()
           
 RasterGeoReference getGeoReference()
           
 int getHeight()
           
 RasterDataInfo getRasterDataInfo()
           
 Set<String> getSupportedFormats()
           
 int getWidth()
           
 AbstractRaster load(File filename, RasterIOOptions options)
          Read the given raster file into an abstract raster.
 AbstractRaster load(InputStream stream, RasterIOOptions options)
          Read the given input stream into an abstract raster.
 BufferResult read(RasterRect rect, ByteBuffer buffer)
           
 boolean shouldCreateCacheFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XYZReader

public XYZReader()
Method Detail

canLoad

public boolean canLoad(File filename)
Description copied from interface: RasterReader
Check if the raster reader is able to read the given raster file.

Specified by:
canLoad in interface RasterReader
Returns:
true if the class can read the raster

getSupportedFormats

public Set<String> getSupportedFormats()
Specified by:
getSupportedFormats in interface RasterReader
Returns:
a Set of (image) formats mime/types the implementation is able to read.

load

public AbstractRaster load(File filename,
                           RasterIOOptions options)
                    throws IOException
Description copied from interface: RasterReader
Read the given raster file into an abstract raster.

Specified by:
load in interface RasterReader
Returns:
the loaded raster
Throws:
IOException - may be thrown when there is a problem with reading the raster.

load

public AbstractRaster load(InputStream stream,
                           RasterIOOptions options)
                    throws IOException
Description copied from interface: RasterReader
Read the given input stream into an abstract raster.

Specified by:
load in interface RasterReader
Returns:
the loaded raster
Throws:
IOException - may be thrown when there is a problem with reading the raster.

file

public File file()
Specified by:
file in interface RasterReader
Returns:
the file from which the raster was read.

getGeoReference

public RasterGeoReference getGeoReference()
Specified by:
getGeoReference in interface RasterReader
Returns:
the geo reference of the read raster

getHeight

public int getHeight()
Specified by:
getHeight in interface RasterReader
Returns:
the height (in pixels) of the read raster

getWidth

public int getWidth()
Specified by:
getWidth in interface RasterReader
Returns:
the width (in pixels) of the read raster

read

public BufferResult read(RasterRect rect,
                         ByteBuffer buffer)
                  throws IOException
Specified by:
read in interface RasterReader
Parameters:
rect - to read.
buffer - to store the result in
Returns:
the read buffer and its domain
Throws:
IOException

shouldCreateCacheFile

public boolean shouldCreateCacheFile()
Specified by:
shouldCreateCacheFile in interface RasterReader
Returns:
true if a cache file should be created for the read raster.

getRasterDataInfo

public RasterDataInfo getRasterDataInfo()
Specified by:
getRasterDataInfo in interface RasterReader
Returns:
the raster data info

canReadTiles

public boolean canReadTiles()
Description copied from interface: RasterReader
should return true if the given reader can easily read tiles,without consuming much more memory than needed.

Specified by:
canReadTiles in interface RasterReader
Returns:
true if the reader can easily read tiles.

getDataLocationId

public String getDataLocationId()
Specified by:
getDataLocationId in interface RasterReader
Returns:
a String which identifies this reader for used the data source, for example the file name, or an url.

dispose

public void dispose()
Description copied from interface: RasterReader
Signals the reader that it should try to dispose all in memory data.

Specified by:
dispose in interface RasterReader


Copyright © 2011. All Rights Reserved.