public class TLcdWCSProxy extends TLcdDataObject implements ILcdMultilevelRaster
ILcdMultilevelRaster
, which fetches its data on the fly from a WCS which is
specified at construction time.
The bounds, resolution, tiling and multileveling of the raster can be
configured by the user at any time. Note, however, that changing any of
these parameters invalidates all data in the raster. By default,
sensible values for the tiled multilevel raster structure are determined
based on the WCS coverage bounds.
TLcdWCSProxy
cannot be instantiated directly. Use TLcdWCSProxyModelFactory
to create WCS proxy models.
If the setAsynchronousUpdates(boolean)
property is true,
TLcdWCSProxy
will perform requests to the WCS server on a separate thread.
This will in turn result in incremental updates of the view when the proxy
is painted, which improves the responsiveness of the application. Note,
however, that the property
TLcdMultilevelRasterPainter.setUseDeferredSubTileDecoding(boolean)
is best switched off in this case. If it is on, the raster painter may defer
the view update a second time, increasing the delay with which the coverage
data is actually shown.
This class also implements the imaging API using a has-an-image paradigm.
It is a TLcdDataObject
of a TLcdDataType
that has a TLcdHasGeometryAnnotation
.
You can get the ALcdImage
object using ALcdImage.fromDomainObject(Object)
where you pass an
instance of this class as argument.
Because an ALcdImage
represents read-only data, a new such object is created whenever a relevant
configuration parameter changes.
For example, when you set a different bounds on this proxy, a new ALcdImage
will be created.
You have to get the ALcdImage
again using ALcdImage.fromDomainObject(Object)
in order to get the
updated image.
References to outdated ALcdImage
s are still valid, but they will be outdated.
When using the imaging API, behavior is always synchronous and the configuration parameter
setAsynchronousUpdates(boolean)
is ignored.
TLcdWCSProxyModelFactory
Modifier and Type | Class and Description |
---|---|
static class |
TLcdWCSProxy.BoundsType
Enumeration class for defining the interpretation of the request bounds.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
ILcdBounds |
getBounds()
Returns the 2D bounds of the area that is currently retrieved for the requested coverage.
|
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdBounds |
getCoverageBounds()
Returns the 2D bounds of the available area for the requested coverage.
|
TLcdWCSCoverageOffering |
getCoverageOffering()
Returns a
TLcdWCSCoverageOffering describing the requested coverage. |
ILcdExceptionHandler |
getExceptionHandler()
Returns the current exception handler.
|
TLcdWCSInterpolationMethod |
getInterpolationMethod()
Return the interpolation method with which the coverage is approximated.
|
ILcdRaster |
getRaster(int aIndex) |
int |
getRasterCount() |
int |
getTileColumnCount()
Return the number of tile columns in the most detailed raster.
|
int |
getTilePixelHeight()
Returns the height of a single raster tile in pixels.
|
int |
getTilePixelWidth()
Returns the width of a single raster tile in pixels.
|
int |
getTileRowCount()
Return the number of tile rows in the most detailed raster.
|
String[] |
getTimeInstants()
Returns the time instants used to request a subset of the specified coverage.
|
String[][] |
getTimeIntervals()
Returns the time intervals used to request a subset of the specified coverage.
|
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
invalidate()
Marks the raster as invalid, which will cause it to be reconstructed the
next time it is accessed.
|
boolean |
isAsynchronousUpdates()
Returns true if asynchronous updating is enabled.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setAsynchronousUpdates(boolean aAsynchronousUpdates)
Specifies whether or not the WCS proxy should retrieve data
asynchronously.
|
void |
setBounds(ILcdBounds aBounds)
Sets the 2D bounds of the area that should be retrieved.
|
void |
setBounds(ILcdBounds aBounds,
ILcdGeoReference aBoundsReference)
Sets the 2D bounds of the area that should be retrieved.
|
void |
setBoundsType(TLcdWCSProxy.BoundsType aBoundsType)
Sets the interpretation of the request bounds (see
setBounds(com.luciad.shape.ILcdBounds) and
setBounds(com.luciad.shape.ILcdBounds, com.luciad.reference.ILcdGeoReference) ). |
void |
setErrorImage(BufferedImage aErrorImage)
Sets the image that is displayed when a WCS tile could not be retrieved due to an error.
|
void |
setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
Sets an exception handler to use when exceptions occur while connecting to
the WCS.
|
void |
setInterpolationMethod(TLcdWCSInterpolationMethod aInterpolationMethod)
Sets the interpolation method with which the coverage should be approximated.
|
void |
setPlaceholderImage(BufferedImage aPlaceholderImage)
Sets the image that is displayed while a WCS tile is being loaded.
|
void |
setRasterCount(int aLevelCount)
Sets the number of levels in the raster.
|
void |
setResolution(double aResX,
double aResY)
Set the resolution of each single raster tile.
|
void |
setTileColumnCount(int aTileColumnCount)
Sets the number of tile columns that should be created for the most detailed raster.
|
void |
setTilePixelHeight(int aTilePixelHeight)
Sets the height of each single raster tile in pixels.
|
void |
setTilePixelWidth(int aTilePixelWidth)
Sets the width of each single raster tile in pixels.
|
void |
setTileRowCount(int aTileRowCount)
Sets the number of tile rows that should be created for the most detailed raster.
|
void |
setTimeInstants(String[] aTimes)
Sets one or more time instants to request a subset of the specified coverage.
|
void |
setTimeIntervals(String[][] aTimeIntervals)
Sets one or more time intervals to request a subset of the specified coverage.
|
public void invalidate()
public TLcdWCSCoverageOffering getCoverageOffering()
TLcdWCSCoverageOffering
describing the requested coverage.TLcdWCSCoverageOffering
describing the requested coverage.public ILcdBounds getCoverageBounds()
public ILcdBounds getBounds()
getBounds
in interface ILcdBounded
public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
aKey
- the key Object that will be used to identify the Object.
The key must therefore be a unique identifier, typically the caller
itself: insertIntoCache(this, ...)
.aObject
- the Object to be cached.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public int getRasterCount()
getRasterCount
in interface ILcdMultilevelRaster
ILcdRaster
objects in this ILcdMultilevelRaster
.public ILcdRaster getRaster(int aIndex)
getRaster
in interface ILcdMultilevelRaster
ILcdRaster
at level aLevel.public void setTileRowCount(int aTileRowCount)
aTileRowCount
- the tile row countIllegalArgumentException
- if the given tile row count is negative or zero.public void setTileColumnCount(int aTileColumnCount)
aTileColumnCount
- the tile column countIllegalArgumentException
- if the given tile column count is negative or zero.public void setTilePixelWidth(int aTilePixelWidth)
aTilePixelWidth
- the new tile widthIllegalArgumentException
- if the given tile pixel width is negative or zero.setResolution(double, double)
public void setTilePixelHeight(int aTilePixelHeight)
aTilePixelHeight
- the new tile heightIllegalArgumentException
- if the given tile pixel height is negative or zero.setResolution(double, double)
public void setResolution(double aResX, double aResY)
aResX
- resolution on the X-axisaResY
- resolution on the Y-axisIllegalArgumentException
- if one of the resolution is negative or zero.setTilePixelWidth(int)
,
setTilePixelHeight(int)
public void setBounds(ILcdBounds aBounds)
null
is supplied as bounds,
the request bounds are reset to the coverage bounds (see getCoverageBounds()
.
By default, the bounds are equal to the coverage bounds.aBounds
- the request boundspublic void setBounds(ILcdBounds aBounds, ILcdGeoReference aBoundsReference)
null
is supplied as bounds, the request bounds are reset to the coverage bounds
(see getCoverageBounds()
.
By default, the bounds are equal to the coverage bounds.aBounds
- the request boundsaBoundsReference
- the reference of the request boundspublic void setBoundsType(TLcdWCSProxy.BoundsType aBoundsType)
setBounds(com.luciad.shape.ILcdBounds)
and
setBounds(com.luciad.shape.ILcdBounds, com.luciad.reference.ILcdGeoReference)
).
By default, the bounds type is TLcdWCSProxy.BoundsType.BOUNDS_2D
, indicating that the request bounds
are interpreted as 2-dimensional bounds.aBoundsType
- The interpretation of the request boundsNullPointerException
- if the bounds type is null
public void setRasterCount(int aLevelCount)
aLevelCount
- the desired number of raster levelsIllegalArgumentException
- if the given level count is negative or zero.public void setTimeInstants(String[] aTimes)
aTimes
- time instants to request a subset of a coveragepublic void setTimeIntervals(String[][] aTimeIntervals)
aTimeIntervals
- time intervals to request a subset of a coveragepublic void setInterpolationMethod(TLcdWCSInterpolationMethod aInterpolationMethod)
aInterpolationMethod
- the interpolation methodpublic TLcdWCSInterpolationMethod getInterpolationMethod()
public void setPlaceholderImage(BufferedImage aPlaceholderImage)
aPlaceholderImage
- the placeholder imagepublic void setErrorImage(BufferedImage aErrorImage)
aErrorImage
- the error imagepublic void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
aExceptionHandler
- an exception handlerpublic String[] getTimeInstants()
setTimeInstants(String[])
public String[][] getTimeIntervals()
setTimeIntervals(String[][])
public ILcdExceptionHandler getExceptionHandler()
public void setAsynchronousUpdates(boolean aAsynchronousUpdates)
If this property is set to false, all updates to the WCS proxy will be performed synchronously on the calling thread.
aAsynchronousUpdates
- true if asynchronous updating should be usedpublic boolean isAsynchronousUpdates()
setAsynchronousUpdates(boolean)
public int getTileRowCount()
setTileRowCount(int)
public int getTileColumnCount()
setTileColumnCount(int)
public int getTilePixelWidth()
public int getTilePixelHeight()