Class TLcdEarthRasterAssetCodec

java.lang.Object
com.luciad.earth.metadata.format.TLcdEarthRasterAssetCodec
All Implemented Interfaces:
ILcdEarthAssetCodec
Direct Known Subclasses:
TLcdEarthClippedRasterAssetCodec

public class TLcdEarthRasterAssetCodec extends Object implements ILcdEarthAssetCodec
A codec for TLcdEarthRasterAsset objects.
Since:
8.2
  • Constructor Details

    • TLcdEarthRasterAssetCodec

      public TLcdEarthRasterAssetCodec()
      Creates a raster asset codec that uses the default model decoder factory.
    • TLcdEarthRasterAssetCodec

      public TLcdEarthRasterAssetCodec(ILcdEarthNamedModelDecoderFactory aNamedModelDecoderFactory)
      Creates a raster asset codec that uses the given model decoder factory to convert names to model decoders and vice versa.
      Parameters:
      aNamedModelDecoderFactory - A model decoder factory.
  • Method Details

    • getNamedModelDecoderFactory

      public ILcdEarthNamedModelDecoderFactory getNamedModelDecoderFactory()
      Returns the model decoder factory used to convert names to model decoders and vice versa.
      Returns:
      a model decoder factory
    • setNamedModelDecoderFactory

      public void setNamedModelDecoderFactory(ILcdEarthNamedModelDecoderFactory aNamedModelDecoderFactory)
      Sets the model decoder factory used to convert names to model decoders and vice versa.
      Parameters:
      aNamedModelDecoderFactory - the model decoder factory that should be used
    • isModelDecoderOptional

      public boolean isModelDecoderOptional()
      Returns whether the model decoder is an optional field.

      If the model decoder is an optional field the encoding/decoding will not fail due to a missing, invalid or unsupported model decoder. Typically the model decoder is only required if the assets will be used for preprocessing because this requires loading the actual source data.

      The default value is true.

      Returns:
      whether the model decoder is an optional field
    • setModelDecoderOptional

      public void setModelDecoderOptional(boolean aModelDecoderOptional)
      sets whether the model decoder is an optional field.
      Parameters:
      aModelDecoderOptional - whether the model decoder should be an optional field
      See Also:
    • decodeAsset

      public ILcdEarthAsset decodeAsset(Properties aProperties)
      Calls createAsset() to create a new instance of ILcdEarthAsset.
      Specified by:
      decodeAsset in interface ILcdEarthAssetCodec
      Parameters:
      aProperties - the properties of the asset
      Returns:
      a new ILcdEarthAsset
    • getModelDecoderForFormatName

      protected ILcdModelDecoder getModelDecoderForFormatName(String aFormatName, boolean forceChangeModelReferenceDecoder)
      Returns a model decoder for the given format name.
      Parameters:
      aFormatName - The format name of the requested model decoder.
      forceChangeModelReferenceDecoder - Whether the model reference decoder should always be changed if possible. Even if the model decoder already has one by default.
      Returns:
      The model decoder for the given format name.
    • createAsset

      protected TLcdEarthRasterAsset createAsset(Properties aProperties, String aSource, ILcdModelDecoder aModelDecoder, ILcdBounds aBounds, ILcdEarthTileSetCoverage.CoverageType aCoverageType, double aPixelDensity, Date aDate)
      Creates an raster asset with the given parameters. The aProperties parameter corresponds to that of decodeAsset(); the other parameters are values that have already been decoded from these properties.
      Parameters:
      aProperties - The asset properties.
      aSource - The asset source name.
      aModelDecoder - The asset model decoder.
      aBounds - The asset bounds.
      aCoverageType - The asset coverage type.
      aPixelDensity - The asset pixel density.
      aDate - The asset modification date.
      Returns:
      A new raster asset.
    • encodeAsset

      public Properties encodeAsset(ILcdEarthAsset aAsset)
      Description copied from interface: ILcdEarthAssetCodec
      Create a Properties object based on an ILcdEarthAsset
      Specified by:
      encodeAsset in interface ILcdEarthAssetCodec
      Parameters:
      aAsset - the asset to encode into a Properties object
      Returns:
      a Properties object based on an ILcdEarthAsset
    • getFormatNameForModelDecoder

      protected String getFormatNameForModelDecoder(ILcdModelDecoder aModelDecoder)
      Returns the format name for the given model decoder.
      Parameters:
      aModelDecoder - The model decoder.
      Returns:
      The format name of the given model decoder.
    • canDecodeAsset

      public boolean canDecodeAsset(Properties aProperties)
      Description copied from interface: ILcdEarthAssetCodec
      Returns true if this codec can create an ILcdEarthAsset based on the given Properties object.
      Specified by:
      canDecodeAsset in interface ILcdEarthAssetCodec
      Parameters:
      aProperties - a Properties object representing an ILcdEarthAsset
      Returns:
      true if the properties can be decoded by this codec
    • canEncodeAsset

      public boolean canEncodeAsset(ILcdEarthAsset aAsset)
      Description copied from interface: ILcdEarthAssetCodec
      Returns true if this codec can create a Properties object for the given ILcdEarthAsset.
      Specified by:
      canEncodeAsset in interface ILcdEarthAssetCodec
      Parameters:
      aAsset - the ILcdEarthAsset to be encoded
      Returns:
      true if this codec can encode the given asset
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdEarthAssetCodec
      Returns a user-displayable name for this codec.
      Specified by:
      getDisplayName in interface ILcdEarthAssetCodec
      Returns:
      a user-displayable name for this codec