Class ALfnCoverageMetadata

java.lang.Object
com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata
com.luciad.fusion.tilestore.metadata.ALfnCoverageMetadata
All Implemented Interfaces:
ILcdBounded
Direct Known Subclasses:
TLfnCoverageMetadata, TLfnRasterCoverageMetadata, TLfnVectorCoverageMetadata

public abstract class ALfnCoverageMetadata extends ALfnResourceMetadata implements ILcdBounded
A representation of a coverage. It provides the following parameters in addition to those defined in the superclass:
  • type: the data type of a coverage, one of ELfnDataType. If not set or set to null, an auto-default value will be used based on the assets' types.
  • bounding box: the 2D bounding box of a coverage. If not set or set to null, an auto-default value will be used based on the union of the bounding boxes of the assets.
  • geographic reference: the geographic reference of the bounding box. If not nset or set to null, an auto-default value will be used based on the common geographic references of the assets, or EPSG:4326 if the assets don't have a common geographic reference.
  • format: the format of the tile data provided by this coverage. If not set or set to null, an auto-default value will be used based on the assets' types.
  • level 0 row count: the # rows at level 0, which is the least detailed level. If not set or set to a negative value, an auto-default value will be used such that the tiles are square as much as possible.
  • level 0 column count: the # columns at level 0. If not set or set to a negative value, an auto-default value will be used such that the tiles are square as much as possible.
  • assets: the assets which contributed to the coverage. If not set or set to null, this defaults to the empty list.
  • scale denominators: the scale denominators identifying the scales at which this coverage is best used. If not set or set to null, this defaults to the empty list.

Instances of this class are immutable, thus thread-safe.

Asset info status

The asset info status tells if an asset has already been completely fused in a coverage or not. Initially, the status is ALfnCoverageMetadata.AssetInfo.STATUS_INCOMPLETE. While fusion is ongoing, the status remains STATUS_COMPLETE. Once fusion is done, the fusion engine sets the statuses of all assets in a coverage to ALfnCoverageMetadata.AssetInfo.STATUS_COMPLETE, hereby bumping the coverage metadata's update sequence.

When adding a new asset to a coverage, its status should always be STATUS_INCOMPLETE. You should never 'choose' to change the status to STATUS_COMPLETE, that is the responsibility of the fusion engine.

Resource metadata resolvers

In order to compute auto-defaults for its properties, an ALfnCoverageMetadata.Builder needs access to the asset metadata. An ILfnResourceMetadataResolver allows a builder to gain access to the asset metadata using an asset ID.

You need a resolver if both the following conditions are true:

  1. You need the builder to compute auto-defaults from the asset metadata.
  2. You haven't passed the asset metadata directly to the builder using ALfnCoverageMetadata.Builder.addAssetInfo(ALfnAssetMetadata, String).
You do not need a resolver if one of the following conditions is true:
  • You don't need auto-defaults, for example because you set all properties explicitly, or because the static defaults suffice.
  • You've passed all asset metadata explicitly to the builder using ALfnCoverageMetadata.Builder.addAssetInfo(ALfnAssetMetadata, String).
  • Examples

    Use specific values for a coverage's geographic reference and bounding box, leave everything else to the auto-defaults:
    
     ALfnAssetMetadata assetMetadata1;
     ALfnAssetMetadata assetMetadata2;
     TLcdGeodeticReference epsg4326 = new TLcdGeodeticReference();
     ILcdBounds world = new TLcdLonLatBounds(-180, -90, 360, 180);
     ALfnCoverageMetadata coverageMetadata = TLfnRasterCoverageMetadata
         .newBuilder()
         .assetInfo(assetMetadata1)
         .assetInfo(assetMetadata2)
         .geoReference(epsg4326)
         .boundingBox(world)
         .build();
     
    Given a coverage, create a new coverage and reset its geographic reference and bounding box to the auto-defaults. We have to us a resource resolver so that the builder can resolve asset IDs to asset metadata:
    
     List<ALfnAssetMetadata> assetMetadatas = Arrays.asList(assetMetadata1, assetMetadata2);
     ILfnResourceMetadataResolver resolver = new TLfnCollectionResourceMetadataResolver(assetMetadatas);
     ALfnCoverageMetadata newCoverageMetadata = coverageMetadata
         .asBuilder(resolver)
         .geoReference(null)
         .boundingBox(null)
         .build();
     
    Since:
    10.0
    • Method Details

      • getType

        public ELfnDataType getType()
        Gets the type of this coverage.

        OGC filter property XPath: lts:Type

        Since 2013.1 the type may be null when isAssetSourcesInTileStore() is true. In this case the coverage only contains the raw asset data but has no tile structure. Parameters such as format, geo reference then become irrelevant (although they may still be defined).
        Returns:
        the type of the coverage, never null when isAssetSourcesInTileStore() is false, possibly null when isAssetSourcesInTileStore() is true
      • isAssetSourcesInTileStore

        public boolean isAssetSourcesInTileStore()
        Tells whether or not the asset sources are in the Tile Store. The default is false.

        When true, fusion will copy the asset sources into the Tile Store for all assets of this coverage. Such a coverage does not need to have a tile structure. Both the WMS "GetMap" and "GetFeatureInfo" requests will be served using the asset sources.

        When a coverage has both asset sources and a tile structure, the image tiles will be used to serve WMS "GetMap" requests while the asset data will be used to serve WMS "GetFeatureInfo" requests.

        When this method returns false, this coverage must have a tile structure.

        Returns:
        whether or not the asset sources of the assets of this coverage are in the Tile Store
        Since:
        2013.1
      • getFeatureTypeStyles

        public List<TLcdSLDFeatureTypeStyle> getFeatureTypeStyles()

        Gets the SLD feature type styles to be used for the visualization of this coverage. The SLD feature type styles are possibly empty, but never null. The default is an empty list.

        Returns:
        the SLD feature type styles to be used for the visualization of this coverage, possibly empty but never null
        Since:
        2013.1
        See Also:
      • getLevel0RowCount

        public long getLevel0RowCount()
        Gets the number of rows at level 0 of this coverage. Sane values are in the range [1..15], although this is not enforced.

        OGC filter property XPath: lts:Level0RowCount

        Returns:
        the number of rows at level 0
      • getLevel0ColumnCount

        public long getLevel0ColumnCount()
        Gets the number of columns at level 0 of this coverage. Sane values are in the range [1..15], although this is not enforced.

        OGC filter property XPath: lts:Level0ColumnCount

        Returns:
        the number of columns at level 0
      • getBoundingBox

        public ILcdBounds getBoundingBox()
        Gets the bounding box of this coverage.

        OGC filter property XPath: lts:BoundingBox
        This property can be used with the OGC filter bounding box operator

        Returns:
        the bounding box, never null
      • getGeoReference

        public ILcdGeoReference getGeoReference()
        Gets the geographic reference of this coverage.

        OGC filter property XPath: lts:GeoReference

        Returns:
        the geographic reference, never null
      • getFormat

        public String getFormat()
        Gets the format of this coverage.

        The format is a MIME type.

        OGC filter property XPath: lts:Format

        Returns:
        a format, never null
      • getFormatVersion

        public String getFormatVersion()
        Gets the format version of this coverage.

        The format version indicates which version of a format is used in the coverage, if multiple versions exist. null indicates that a format version is irrelevant for this coverage's format.

        For the built-in formats, only the Vector Tile format currently has multiple versions, 0 and 1.0. The main difference between the two versions is that version 1.0 supports text features. When backwards compatibility is not required, always use the latest version.

        OGC filter property XPath: lts:FormatVersion

        Returns:
        a format version, possibly null
      • getAssetInfos

        public List<ALfnCoverageMetadata.AssetInfo> getAssetInfos()
        Gets the list of asset infos of this coverage. The order of the assets is not relevant.

        OGC filter property XPath: lts:AssetInfo/assetInfoPropertyName
        See ALfnCoverageMetadata.AssetInfo for the asset info property names.

        Returns:
        a list of assets, possibly empty but never null
      • getScaleDenominators

        public List<Integer> getScaleDenominators()
        Gets the denominators of the scales at which this coverage will typically be viewed. The corresponding scale is 1:denominator.

        The scale is expressed as the ratio between a distance on the displayed map and the corresponding distance in the real geographic environment. For instance, a scale of 1:1000 means that 1 centimeter on the map corresponds to 1000 centimeters in the real geographic context represented by the map.

        The returned list is immutable thus thread-safe.

        OGC filter property XPath: lts:ScaleDenominator

        The scale denominators are optional, and may be empty. When present, they may be used by client applications as hints as to which scales the coverage is best viewed at. For example the "CTRL-mousewheel" zoom controller uses it to snap-zoom.

        It is not required that the scale denominators are related to its levels, although this will often be the case. For vector data, it is possible to use the scale denominators to "override" the default visualization levels with. See TLfnGXYVectorLayer.setUseCoverageScalesAsLevelScales(boolean).

        Returns:
        a list of scale denominators, possibly empty but never null
        Since:
        11.0
      • getDataDensity

        public ELfnDataDensity getDataDensity()
        Returns what the density of the data in the coverage is.

        The data density information can be used by rendering engines as a hint on how to render the data in a coverage, for example, which tiles are rendered on screen, which level of detail is chosen for a given scale, how the rendering of the data towards the horizon is done, ...

        The default is ELfnDataDensity.OVERVIEW for TLfnVectorCoverageMetadata and null for others.

        Returns:
        the density of the data in the coverage, possibly null
        See Also:
      • getBounds

        public ILcdBounds getBounds()
        Returns the bounding box of this coverage. This method behaves exactly the same as getBoundingBox(), it exists solely to implement the ILcdBounded interface.
        Specified by:
        getBounds in interface ILcdBounded
        Returns:
        the bounding box of this coverage, never null
        See Also:
      • getMessageDigestAlgorithm

        public String getMessageDigestAlgorithm()
        Gets the message digest algorithm of this coverage, possibly null. The message digest algorithm may be used to sign each tile, which can be used on the server to do corruption checks on a coverage on a per-tile basis.

        An example of a message digest algorithm is "MD5". A message digest algorithm is valid if MessageDigest.getInstance(String) returns a valid message digest instance.

        Note that setting a message digest algorithm will in not in itself trigger the actual signing of tiles. In order to perform signing, you should use the TLfnDigestTileStore decorator.

        Returns:
        the message digest algorithm for signing tiles of this coverage, possibly null
        Since:
        2012.0
      • isIgnoreNonFatalFailures

        public boolean isIgnoreNonFatalFailures()
        Indicates whether non-fatal failures can be ignored during the fusion process.

        • If true: the fusion process may continue when certain failures occur, for example missing or corrupt source data
        • If false: the fusion process must immediately abort

        By default, this is false.

        If set to true, the fusion processing engine will report these non-fatal failures for inspection.

        Returns:
        true if non-fatal failures may be ignored, false if the fusion process should fail
        Since:
        2013.0
      • equals

        public boolean equals(Object aObject)
        Overrides:
        equals in class ALfnResourceMetadata
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class ALfnResourceMetadata
      • asBuilder

        public abstract ALfnCoverageMetadata.Builder<?> asBuilder()
        Description copied from class: ALfnResourceMetadata
        Creates a new builder from this resource metadata. The builder's fields are initialized to the values of this resource metadata. The builder will build a resource metadata of the same type as this instance.
        Specified by:
        asBuilder in class ALfnResourceMetadata
        Returns:
        a new builder
      • asBuilder

        public abstract ALfnCoverageMetadata.Builder<?> asBuilder(ILfnResourceMetadataResolver aResolver)
        Creates a new builder from this coverage metadata using a given resolver. If not null, the resolver is used to resolve asset metadata when computing a coverage's auto-defaults. See ALfnCoverageMetadata.Builder for the uses of a resolver.
        Parameters:
        aResolver - a resolver to resolve the asset metadata for computing auto-defaults, which may be null
        Returns:
        this builder
        Since:
        2014.0