Class TLcdWCSProxy

java.lang.Object
com.luciad.datamodel.TLcdDataObject
com.luciad.ogc.wcs.client.TLcdWCSProxy
All Implemented Interfaces:
ILcdDataObject, ILcdBounded, ILcdCache, ILcdCloneable, ILcdDeepCloneable, Cloneable

public class TLcdWCSProxy extends TLcdDataObject implements ILcdBounded, ILcdCache
A client for OpenGIS Web Coverage Services (WCS).

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:
  • Method Details

    • invalidate

      public void invalidate()
      Marks the WCS proxy image as invalid, which causes it to be reconstructed.
    • getCoverageOffering

      public TLcdWCSCoverageOffering getCoverageOffering()
      Returns a TLcdWCSCoverageOffering describing the requested coverage.
      Returns:
      a TLcdWCSCoverageOffering describing the requested coverage.
    • getCoverageBounds

      public ILcdBounds 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

      public ILcdBounds getBounds()
      Returns the 2D bounds of the area that is currently retrieved for the requested coverage.
      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the 2D bounds of the area that is currently retrieved for the requested coverage.
    • insertIntoCache

      public void insertIntoCache(Object aKey, Object aObject)
      Description copied from interface: ILcdCache
      Inserts a cache Object corresponding to the given key Object.
      Specified by:
      insertIntoCache in interface ILcdCache
      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

      public Object getCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and returns the cached Object corresponding to the given key.
      Specified by:
      getCachedObject in interface ILcdCache
      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

      public Object removeCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and removes the cached Object corresponding to the given key.
      Specified by:
      removeCachedObject in interface ILcdCache
      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: ILcdCache
      Clears the cache.
      Specified by:
      clearCache in interface ILcdCache
    • 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-axis
      aResY - resolution on the Y-axis
      Throws:
      IllegalArgumentException - if one of the resolution is negative or zero.
      See Also:
    • setBounds

      public void setBounds(ILcdBounds aBounds)
      Sets the 2D bounds of the area that should be retrieved. The bounds should be expressed in the reference of the enclosing proxy model. If 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.

      Parameters:
      aBounds - the request bounds
    • setBounds

      public void setBounds(ILcdBounds aBounds, ILcdGeoReference aBoundsReference)
      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. If 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.

      Parameters:
      aBounds - the request bounds
      aBoundsReference - the reference of the request bounds
    • setBoundsType

      public 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)).

      By default, the bounds type is TLcdWCSProxy.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 is null
    • 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

      public void setTimeInstants(String[] aTimes)
      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

      public void setTimeIntervals(String[][] aTimeIntervals)
      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

      public void setInterpolationMethod(TLcdWCSInterpolationMethod aInterpolationMethod)
      Sets the interpolation method with which the coverage should be approximated.
      Parameters:
      aInterpolationMethod - the interpolation method
    • getInterpolationMethod

      public TLcdWCSInterpolationMethod getInterpolationMethod()
      Return the interpolation method with which the coverage is approximated.
      Returns:
      the interpolation method
    • setExceptionHandler

      public void setExceptionHandler(ILcdExceptionHandler aExceptionHandler)
      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

      public String[] 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

      public String[][] 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

      public ILcdExceptionHandler 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