Class TLcdWCSProxy
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdCache,ILcdCloneable,ILcdDeepCloneable,Cloneable
This class allows fetching data, on the fly, from a WCS which is specified at construction time.
This class 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.
The bounds, resolution, tiling and multilevel of the image can be configured by the user at any time. Note, however, that changing any of these parameters invalidates all data in the image. By default, sensible values for the tiled multilevel image structure is determined based on the WCS coverage bounds.
TLcdWCSProxy cannot be instantiated directly.
Use TLcdWCSProxyModelFactory to create WCS proxy models.
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 is created.
You have to get the ALcdImage again using ALcdImage.fromDomainObject(Object) in order to get the
updated image.
References to outdated ALcdImages are still valid, but they will be outdated.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEnumeration class for defining the interpretation of the request bounds. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.Returns the 2D bounds of the area that is currently retrieved for the requested coverage.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the 2D bounds of the available area for the requested coverage.Returns aTLcdWCSCoverageOfferingdescribing the requested coverage.Returns the current exception handler.Return the interpolation method with which the coverage is approximated.intReturns the number of levels used by the WCS proxy.intReturns the number of tile columns in the most detailed image level.intReturns the height of a single image tile in pixels.intReturns the width of a single image tile in pixels.intReturns the number of tile rows in the most detailed image level.String[]Returns the time instants used to request a subset of the specified coverage.String[][]Returns the time intervals used to request a subset of the specified coverage.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.voidMarks the WCS proxy image as invalid, which causes it to be reconstructed.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidsetBounds(ILcdBounds aBounds) Sets the 2D bounds of the area that should be retrieved.voidsetBounds(ILcdBounds aBounds, ILcdGeoReference aBoundsReference) Sets the 2D bounds of the area that should be retrieved.voidsetBoundsType(TLcdWCSProxy.BoundsType aBoundsType) Sets the interpretation of the request bounds (seesetBounds(com.luciad.shape.ILcdBounds)andsetBounds(com.luciad.shape.ILcdBounds, com.luciad.reference.ILcdGeoReference)).voidsetExceptionHandler(ILcdExceptionHandler aExceptionHandler) Sets an exception handler to use when exceptions occur while connecting to the WCS.voidsetInterpolationMethod(TLcdWCSInterpolationMethod aInterpolationMethod) Sets the interpolation method with which the coverage should be approximated.voidsetLevelCount(int aLevelCount) Sets the number of levels in the image.voidsetResolution(double aResX, double aResY) Set the resolution of each single image tile.voidsetTileColumnCount(int aTileColumnCount) Sets the number of tile columns that should be created for the most detailed image level.voidsetTilePixelHeight(int aTilePixelHeight) Sets the height of each single image tile in pixels.voidsetTilePixelWidth(int aTilePixelWidth) Sets the width of each single image tile in pixels.voidsetTileRowCount(int aTileRowCount) Sets the number of tile rows that should be created for the most detailed image level.voidsetTimeInstants(String[] aTimes) Sets one or more time instants to request a subset of the specified coverage.voidsetTimeIntervals(String[][] aTimeIntervals) Sets one or more time intervals to request a subset of the specified coverage.
-
Method Details
-
invalidate
public void invalidate()Marks the WCS proxy image as invalid, which causes it to be reconstructed. -
getCoverageOffering
Returns aTLcdWCSCoverageOfferingdescribing the requested coverage.- Returns:
- a
TLcdWCSCoverageOfferingdescribing the requested coverage.
-
getCoverageBounds
Returns the 2D bounds of the available area for the requested coverage.- Returns:
- the 2D bounds of the available area for the requested coverage.
-
getBounds
Returns the 2D bounds of the area that is currently retrieved for the requested coverage.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the 2D bounds of the area that is currently retrieved for the requested coverage.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein interfaceILcdCache- Parameters:
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.
-
getCachedObject
Description copied from interface:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-
setTileRowCount
public void setTileRowCount(int aTileRowCount) Sets the number of tile rows that should be created for the most detailed image level.- Parameters:
aTileRowCount- the tile row count- Throws:
IllegalArgumentException- if the given tile row count is negative or zero.
-
setTileColumnCount
public void setTileColumnCount(int aTileColumnCount) Sets the number of tile columns that should be created for the most detailed image level.- Parameters:
aTileColumnCount- the tile column count- Throws:
IllegalArgumentException- if the given tile column count is negative or zero.
-
setTilePixelWidth
public void setTilePixelWidth(int aTilePixelWidth) Sets the width of each single image tile in pixels. If the tile resolution is specified, the tile width and height are ignored.- Parameters:
aTilePixelWidth- the new tile width- Throws:
IllegalArgumentException- if the given tile pixel width is negative or zero.- See Also:
-
setTilePixelHeight
public void setTilePixelHeight(int aTilePixelHeight) Sets the height of each single image tile in pixels. If the tile resolution is specified, the tile width and height are ignored.- Parameters:
aTilePixelHeight- the new tile height- Throws:
IllegalArgumentException- if the given tile pixel height is negative or zero.- See Also:
-
setResolution
public void setResolution(double aResX, double aResY) Set the resolution of each single image tile. If the tile resolution is specified, the tile width and height are ignored.- Parameters:
aResX- resolution on the X-axisaResY- resolution on the Y-axis- Throws:
IllegalArgumentException- if one of the resolution is negative or zero.- See Also:
-
setBounds
Sets the 2D bounds of the area that should be retrieved. The bounds should be expressed in the reference of the enclosing proxy model. Ifnullis supplied as bounds, the request bounds are reset to the coverage bounds (seegetCoverageBounds(). By default, the bounds are equal to the coverage bounds.- Parameters:
aBounds- the request bounds
-
setBounds
Sets the 2D bounds of the area that should be retrieved. The bounds should be expressed in the supplied reference. A best effort will be made to perform the coverage request using the given reference. Ifnullis supplied as bounds, the request bounds are reset to the coverage bounds (seegetCoverageBounds(). By default, the bounds are equal to the coverage bounds.- Parameters:
aBounds- the request boundsaBoundsReference- the reference of the request bounds
-
setBoundsType
Sets the interpretation of the request bounds (seesetBounds(com.luciad.shape.ILcdBounds)andsetBounds(com.luciad.shape.ILcdBounds, com.luciad.reference.ILcdGeoReference)). By default, the bounds type isTLcdWCSProxy.BoundsType.BOUNDS_2D, indicating that the request bounds are interpreted as 2-dimensional bounds.- Parameters:
aBoundsType- The interpretation of the request bounds- Throws:
NullPointerException- if the bounds type isnull
-
setLevelCount
public void setLevelCount(int aLevelCount) Sets the number of levels in the image.The most detailed level image will have the resolution specified by the user. Lower image levels are constructed by decreasing the number of tiles and/or the resolution of the tiles.
- Parameters:
aLevelCount- the desired number of image levels- Throws:
IllegalArgumentException- if the given level count is negative or zero.- Since:
- 2026.0
-
getLevelCount
public int getLevelCount()Returns the number of levels used by the WCS proxy.- Returns:
- the number of levels used by the WCS proxy.
- Since:
- 2026.0
-
setTimeInstants
Sets one or more time instants to request a subset of the specified coverage. The time instants must be expressed in an (extended) ISO 8601 syntax.- Parameters:
aTimes- time instants to request a subset of a coverage
-
setTimeIntervals
Sets one or more time intervals to request a subset of the specified coverage. The time instants must be expressed in an (extended) ISO 8601 syntax.- Parameters:
aTimeIntervals- time intervals to request a subset of a coverage
-
setInterpolationMethod
Sets the interpolation method with which the coverage should be approximated.- Parameters:
aInterpolationMethod- the interpolation method
-
getInterpolationMethod
Return the interpolation method with which the coverage is approximated.- Returns:
- the interpolation method
-
setExceptionHandler
Sets an exception handler to use when exceptions occur while connecting to the WCS. Exceptions may include service exceptions from the WCS itself, but also client-side exceptions that may occur if the response of the WCS cannot be properly decoded. If the exception handler is not set (or set to null), any exceptions will be silently ignored.- Parameters:
aExceptionHandler- an exception handler
-
getTimeInstants
Returns the time instants used to request a subset of the specified coverage.- Returns:
- the time instants used to request a subset of the specified coverage.
- See Also:
-
getTimeIntervals
Returns the time intervals used to request a subset of the specified coverage.- Returns:
- the time intervals used to request a subset of the specified coverage.
- See Also:
-
getExceptionHandler
Returns the current exception handler.- Returns:
- the current exception handler.
-
getTileRowCount
public int getTileRowCount()Returns the number of tile rows in the most detailed image level.- Returns:
- the number of tile rows in the most detailed image.
- See Also:
-
getTileColumnCount
public int getTileColumnCount()Returns the number of tile columns in the most detailed image level.- Returns:
- the number of tile columns in the most detailed image.
- See Also:
-
getTilePixelWidth
public int getTilePixelWidth()Returns the width of a single image tile in pixels.- Returns:
- the width of a single image tile in pixels
-
getTilePixelHeight
public int getTilePixelHeight()Returns the height of a single image tile in pixels.- Returns:
- the height of a single image tile in pixels
-