Package com.luciad.earth.metadata.format
Class TLcdEarthRasterAssetCodec
java.lang.Object
com.luciad.earth.metadata.format.TLcdEarthRasterAssetCodec
- All Implemented Interfaces:
ILcdEarthAssetCodec
- Direct Known Subclasses:
TLcdEarthClippedRasterAssetCodec
A codec for
TLcdEarthRasterAsset
objects.- Since:
- 8.2
-
Field Summary
Fields inherited from interface com.luciad.earth.metadata.format.ILcdEarthAssetCodec
TYPE_NAME
-
Constructor Summary
ConstructorDescriptionCreates a raster asset codec that uses the default model decoder factory.TLcdEarthRasterAssetCodec
(ILcdEarthNamedModelDecoderFactory aNamedModelDecoderFactory) Creates a raster asset codec that uses the given model decoder factory to convert names to model decoders and vice versa. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeAsset
(Properties aProperties) Returns true if this codec can create an ILcdEarthAsset based on the given Properties object.boolean
canEncodeAsset
(ILcdEarthAsset aAsset) Returns true if this codec can create a Properties object for the given ILcdEarthAsset.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.decodeAsset
(Properties aProperties) CallscreateAsset()
to create a new instance ofILcdEarthAsset
.encodeAsset
(ILcdEarthAsset aAsset) Create a Properties object based on an ILcdEarthAssetReturns a user-displayable name for this codec.protected String
getFormatNameForModelDecoder
(ILcdModelDecoder aModelDecoder) Returns the format name for the given model decoder.protected ILcdModelDecoder
getModelDecoderForFormatName
(String aFormatName, boolean forceChangeModelReferenceDecoder) Returns a model decoder for the given format name.Returns the model decoder factory used to convert names to model decoders and vice versa.boolean
Returns whether the model decoder is an optional field.void
setModelDecoderOptional
(boolean aModelDecoderOptional) sets whether the model decoder is an optional field.void
setNamedModelDecoderFactory
(ILcdEarthNamedModelDecoderFactory aNamedModelDecoderFactory) Sets the model decoder factory used to convert names to model decoders and vice versa.
-
Constructor Details
-
TLcdEarthRasterAssetCodec
public TLcdEarthRasterAssetCodec()Creates a raster asset codec that uses the default model decoder factory. -
TLcdEarthRasterAssetCodec
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
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 istrue
.- 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
CallscreateAsset()
to create a new instance ofILcdEarthAsset
.- Specified by:
decodeAsset
in interfaceILcdEarthAssetCodec
- 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. TheaProperties
parameter corresponds to that ofdecodeAsset()
; 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
Description copied from interface:ILcdEarthAssetCodec
Create a Properties object based on an ILcdEarthAsset- Specified by:
encodeAsset
in interfaceILcdEarthAssetCodec
- Parameters:
aAsset
- the asset to encode into a Properties object- Returns:
- a Properties object based on an ILcdEarthAsset
-
getFormatNameForModelDecoder
Returns the format name for the given model decoder.- Parameters:
aModelDecoder
- The model decoder.- Returns:
- The format name of the given model decoder.
-
canDecodeAsset
Description copied from interface:ILcdEarthAssetCodec
Returns true if this codec can create an ILcdEarthAsset based on the given Properties object.- Specified by:
canDecodeAsset
in interfaceILcdEarthAssetCodec
- Parameters:
aProperties
- a Properties object representing an ILcdEarthAsset- Returns:
- true if the properties can be decoded by this codec
-
canEncodeAsset
Description copied from interface:ILcdEarthAssetCodec
Returns true if this codec can create a Properties object for the given ILcdEarthAsset.- Specified by:
canEncodeAsset
in interfaceILcdEarthAssetCodec
- Parameters:
aAsset
- the ILcdEarthAsset to be encoded- Returns:
- true if this codec can encode the given asset
-
getDisplayName
Description copied from interface:ILcdEarthAssetCodec
Returns a user-displayable name for this codec.- Specified by:
getDisplayName
in interfaceILcdEarthAssetCodec
- Returns:
- a user-displayable name for this codec
-