org.deegree.protocol.wms.raster
Class WMSReader

java.lang.Object
  extended by org.deegree.protocol.wms.raster.WMSReader
All Implemented Interfaces:
RasterReader

public class WMSReader
extends Object
implements RasterReader

TODO add class documentation here

Version:
$Revision: 30118 $, $Date: 2011-03-22 10:01:37 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Field Summary
static String RIO_WMS_DEFAULT_FORMAT
          Defines the default (image) format of a get map request to a WMS.
static String RIO_WMS_ENABLE_TRANSPARENT
          Defines the key to set the GetMap retrieval to transparent.
static String RIO_WMS_LAYERS
          Defines the maximum height of a GetMap request.
static String RIO_WMS_MAX_HEIGHT
          Defines the maximum height of a GetMap request.
static String RIO_WMS_MAX_SCALE
          Defines the maximum scale of a WMS.
static String RIO_WMS_MAX_WIDTH
          Defines the maximum width of a GetMap request.
static String RIO_WMS_REFRESH_TIME
          The refresh time of the capabilities
static String RIO_WMS_SYS_ID
          Defines the system id to be used as raster io key, for setting the system id or the capabilities url.
static String RIO_WMS_TIMEOUT
          Defines the key to set the GetMap retrieval timeout.
 
Constructor Summary
WMSReader()
           
 
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()
           
 WMSClient111 getClient()
           
 ICRS getCRS()
           
 String getDataLocationId()
           
 RasterGeoReference getGeoReference()
           
 int getHeight()
           
 List<String> getLayers()
           
 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 result)
           
 boolean shouldCreateCacheFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIO_WMS_SYS_ID

public static final String RIO_WMS_SYS_ID
Defines the system id to be used as raster io key, for setting the system id or the capabilities url.

See Also:
Constant Field Values

RIO_WMS_REFRESH_TIME

public static final String RIO_WMS_REFRESH_TIME
The refresh time of the capabilities

See Also:
Constant Field Values

RIO_WMS_MAX_WIDTH

public static final String RIO_WMS_MAX_WIDTH
Defines the maximum width of a GetMap request.

See Also:
Constant Field Values

RIO_WMS_MAX_HEIGHT

public static final String RIO_WMS_MAX_HEIGHT
Defines the maximum height of a GetMap request.

See Also:
Constant Field Values

RIO_WMS_LAYERS

public static final String RIO_WMS_LAYERS
Defines the maximum height of a GetMap request.

See Also:
Constant Field Values

RIO_WMS_MAX_SCALE

public static final String RIO_WMS_MAX_SCALE
Defines the maximum scale of a WMS.

See Also:
Constant Field Values

RIO_WMS_DEFAULT_FORMAT

public static final String RIO_WMS_DEFAULT_FORMAT
Defines the default (image) format of a get map request to a WMS.

See Also:
Constant Field Values

RIO_WMS_ENABLE_TRANSPARENT

public static final String RIO_WMS_ENABLE_TRANSPARENT
Defines the key to set the GetMap retrieval to transparent.

See Also:
Constant Field Values

RIO_WMS_TIMEOUT

public static final String RIO_WMS_TIMEOUT
Defines the key to set the GetMap retrieval timeout.

See Also:
Constant Field Values
Constructor Detail

WMSReader

public WMSReader()
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

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.

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

file

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

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.

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

getRasterDataInfo

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

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.

getWidth

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

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.

read

public BufferResult read(RasterRect rect,
                         ByteBuffer result)
                  throws IOException
Specified by:
read in interface RasterReader
Parameters:
rect - to read.
result - 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.

getClient

public WMSClient111 getClient()
Returns:
the wms client

getLayers

public List<String> getLayers()
Returns:
the layers the reader is requesting

getCRS

public ICRS getCRS()
Returns:
the default crs


Copyright © 2011. All Rights Reserved.