Class TLfnCompositeFormat
- Since:
- 10.0
-
Field Summary
Fields inherited from class com.luciad.fusion.engine.format.ALfnFormat
AIXM_FORMAT_ID, AIXM51_FORMAT_ID, ARC_SDE_RASTER_FORMAT_ID, ARC_SDE_VECTOR_FORMAT_ID, BCI_FORMAT_ID, BIL_FORMAT_ID, CADRG_FORMAT_ID, DEM_FORMAT_ID, DGN_FORMAT_ID, DIMAP_FORMAT_ID, DMED_FORMAT_ID, DTED_DIRECTORY_FORMAT_ID, DTED_FORMAT_ID, ECRG_FORMAT_ID, ECW_FORMAT_ID, ETOPO_FORMAT_ID, GDAL_FORMAT_ID, GEO_SPOT_FORMAT_ID, GEO_TIFF_FORMAT_ID, GEOSPATIAL_PDF_FORMAT_ID, GML2_FORMAT_ID, GML31_FORMAT_ID, GML32_FORMAT_ID, JAI_FORMAT_ID, JPEG_2000_FORMAT_ID, JPIP_FORMAT_ID, MAP_FORMAT_ID, MIF_FORMAT_ID, MR_SID_FORMAT_ID, NETCDF_FORMAT_ID, NITF_FORMAT_ID, ORACLE_GEO_RASTER_FORMAT_ID, ORACLE_SPATIAL_FORMAT_ID, POSTGIS_FORMAT_ID, RASTER_TILE_STORE_FORMAT_ID, RST_FORMAT_ID, S57_FORMAT_ID, S63_FORMAT_ID, SHP_FORMAT_ID, SWISS_DHM_FORMAT_ID, TAB_FORMAT_ID, TFW_FORMAT_ID, USRP_FORMAT_ID, VPF_FORMAT_ID, WMTS_FORMAT_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFormat
(ALfnFormat aFormat) Adds an engine format.void
addFormats
(List<ALfnFormat> aFormats) Adds a list of engine formats.boolean
canCreateAsset
(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) Returnsfalse
when the format is certain it cannot create an asset for the given source,true
otherwise.boolean
Deprecated.createAsset
(ILcdModel aModel) Creates an asset for a given model.createAsset
(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) Creates an asset for a given source name.createDataSource
(List<ALfnAssetMetadata.AssetPart> aGroupedAssetParts) This method is responsible for creating anILcdDataSource
which represents allAssetPart
instances inaAssetPartsGroup
.Gets the data source model decoder factory of this format.Returns a read-only list of the registered engine formats.Gets the GXY layer factory of this format, if any.Gets the height provider factory of this format, if any.Gets the (vector) feature ID provider factory of this format, if any.final String
getName()
Warning: this method throws an exception and should not be called.Gets the SLD GXY layer factory of this format, if any.groupAssetPartsForDataSources
(List<ALfnAssetMetadata> aAssetMetadatas) This method is responsible for grouping allAssetPart
instances into groups.boolean
isAssetOfFormat
(ALfnAssetMetadata aAssetMetadata) Returnstrue
whenaAssetMetadata
was created by thisALfnFormat
,false
otherwise.boolean
isAssetPartOfFormat
(ALfnAssetMetadata.AssetPart aAssetPart) Returnstrue
whenaAssetPart
was created by thisALfnFormat
,false
otherwise.boolean
isAssetSourcesInTileStoreSupported
(String aFormatName) Indicates if a format matching the given name exists and supports asset sources in Tile Store.boolean
isModelOfFormat
(ILcdModel aModel) Checks whether a model is of this format.void
removeFormat
(ALfnFormat aFormat) Removes an engine formatvoid
removeFormats
(Collection<ALfnFormat> aFormats) Removes multiple engine formats.final ALfnFormat
retrieveFormatOf
(ALfnAssetMetadata aAssetMetadata) Utility method which loops over all registeredALfnFormat
instances and returns the first format which returnstrue
forALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)
toString()
Methods inherited from class com.luciad.fusion.engine.format.ALfnFormat
createDefaultFormats, getModelDecoderFactory, isAssetSourcesInTileStoreSupported, newElevationFormat, newElevationFormat, newImageFormat, newImageFormat, newVectorFormat, newVectorFormat
-
Constructor Details
-
TLfnCompositeFormat
public TLfnCompositeFormat()Creates an empty composite factory.
-
-
Method Details
-
getSLDGXYLayerFactory
Description copied from class:ALfnFormat
Gets the SLD GXY layer factory of this format, if any.
A layer factory is needed when you want to fuse the data as
ELfnDataType#IMAGE
. The images will be created based on the layer created by the layer factory. When this method returnsnull
, it will not be possible to fuse asIMAGE
.To remain backwards compatible, the default implementation of this method will fall back to the
ALfnFormat.getGXYLayerFactory()
when no SLD layer factory is available but a regularILcdGXYLayerFactory
is.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself. A possible use-case to call this method as API user is if you want to create preview layers of how the fused data will look.
- Overrides:
getSLDGXYLayerFactory
in classALfnFormat
- Returns:
- a layer factory, possibly
null
-
getGXYLayerFactory
Description copied from class:ALfnFormat
Gets the GXY layer factory of this format, if any.
A layer factory is needed when you want to fuse the data as
ELfnDataType.IMAGE
. The images will be created based on the layer created by the layer factory. When this method returnsnull
, it will not be possible to fuse asIMAGE
(see class javadoc).This method is no longer used by LuciadFusion. LuciadFusion uses the
SLD GXY layer factory
method. The recommended way to replace the layer factory of a format is to override theALfnFormat.getSLDGXYLayerFactory()
method.- Overrides:
getGXYLayerFactory
in classALfnFormat
- Returns:
- a GXY layer factory, possibly
null
-
getHeightProviderFactory
Description copied from class:ALfnFormat
Gets the height provider factory of this format, if any.
A height provider factory is needed when you want to fuse the data as
ELfnDataType.ELEVATION
. The elevation values will be extracted from the model using the created height provider. When this method returnsnull
, it will not be possible to fuse asELEVATION
(see class javadoc).Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself.
- Overrides:
getHeightProviderFactory
in classALfnFormat
- Returns:
- a height provider factory, possibly
null
-
getIdentityProviderFactory
Description copied from class:ALfnFormat
Gets the (vector) feature ID provider factory of this format, if any. The default implementation returns
null
.An identity provider factory is needed when you want to fuse the data as
ELfnDataType.VECTOR
. The id's for the features of the model will be retrieved from the identity provider. When this method returnsnull
, it will not be possible to fuse asVECTOR
(see class javadoc).- Overrides:
getIdentityProviderFactory
in classALfnFormat
- Returns:
- a feature ID provider factory, possibly
null
-
getDataSourceModelDecoderFactory
Description copied from class:ALfnFormat
Gets the data source model decoder factory of this format.
If you override this method, you also need to adjust the
ALfnFormat.createDataSource(java.util.List)
method (and perhaps also theALfnFormat.groupAssetPartsForDataSources(java.util.List)
method). The default implementations of these 3 methods depend on each other. If you adjust one of those methods, you need to adjust all of them. Consult the class javadoc for more information on how these methods work together.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself.
- Overrides:
getDataSourceModelDecoderFactory
in classALfnFormat
- Returns:
- a data source model decoder factory, never
null
-
groupAssetPartsForDataSources
public List<List<ALfnAssetMetadata.AssetPart>> groupAssetPartsForDataSources(List<ALfnAssetMetadata> aAssetMetadatas) Description copied from class:ALfnFormat
This method is responsible for grouping all
AssetPart
instances into groups. For each of those groups, anILcdDataSource
will be created by calling theALfnFormat.createDataSource(java.util.List)
method.The default implementation of this method creates groups containing a single
AssetPart
.An example format which might group several
AssetPart
s together is a format which supports base files and updates for those base files. Typically an update file in itself contains not enough information to allow the model decoder to decode it into anILcdModel
(e.g. an update file which only indicates element X must be removed). Instead, you need to group both the base file and update file into anILcdDataSource
and pass it to the model decoder.This method indicates to the fusion process whichAssetPart
s needs to be grouped together when anILcdDataSource
is created. When this method groups theAssetPart
s representing the update file(s) together with the ones corresponding to the base files, they will be passed as one group to theALfnFormat.createDataSource(java.util.List)
method which allows to create anILcdDataSource
representing both the base and update.If you override this method, you also need to adjust the
ALfnFormat.createDataSource(java.util.List)
method and provide a customALfnFormat.getDataSourceModelDecoderFactory()
. The default implementations of these 3 methods depend on each other. If you adjust one of those methods, you need to adjust all of them. Consult the class javadoc for more information on how these methods work together.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself.
- Overrides:
groupAssetPartsForDataSources
in classALfnFormat
- Parameters:
aAssetMetadatas
- All theALfnAssetMetadata
instances available in the coverage.- Returns:
- A
List
containing groups ofAssetPart
instances (where a group is represented by aList
as well). EachAssetPart
group will be passed to theALfnFormat.createDataSource(java.util.List)
method to create anILcdDataSource
.
-
createDataSource
Description copied from class:ALfnFormat
This method is responsible for creating an
ILcdDataSource
which represents allAssetPart
instances inaAssetPartsGroup
. WhichAssetPart
instances are contained inaAssetPartsGroup
is determined by the result of theALfnFormat.groupAssetPartsForDataSources(java.util.List)
method.The default implementation of this method creates
ILcdDataSource
instances which are accepted by the defaultILfnDataSourceModelDecoderFactory
. If you used a constructor which accepts a customILfnDataSourceModelDecoderFactory
, or you have overridden theALfnFormat.getDataSourceModelDecoderFactory()
method, you will have to override this method as well.If you override this method, you also need to provide a custom
ALfnFormat.getDataSourceModelDecoderFactory()
(and possibly also adjust theALfnFormat.groupAssetPartsForDataSources(java.util.List)
method). The default implementations of these 3 methods depend on each other. If you adjust one of those methods, you need to adjust all of them. Consult the class javadoc for more information on how these methods work together.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself.
- Overrides:
createDataSource
in classALfnFormat
- Parameters:
aGroupedAssetParts
- A group ofAssetPart
instances for which anILcdDataSource
must be created. AllAssetPart
instances should have been created by this format.- Returns:
- An
ILcdDataSource
representing allAssetPart
s contained inaAssetPartsGroup
-
canDecode
Deprecated.If you want to know whether the model decoder factory can decode the specified source, you can usegetDataSourceModelDecoderFactory().canDecodeSource(aSource)
. If you want to know whether an asset can be created foraSource
, you can use thecanCreateAsset(String, java.util.List)
method.Returns whether the model decoder factory of this format can decode the specified source.- Parameters:
aSource
- the source- Returns:
true
if the model decoder factory can decoderaSource
-
canCreateAsset
Description copied from class:ALfnFormat
Returns
false
when the format is certain it cannot create an asset for the given source,true
otherwise. This method is a quick check which might be called often and should return quickly.The list of other asset metadatas that is provided may be used by the format to compute asset information which is not available in
aSource
itself, but can only be deduced using information from other, already existing assets. A typical example is an update asset for an existing base asset, which is not self-describing but can only be interpreted in combination with the base asset.Note that
true
does not always imply that a model can be created for the source. As an example, assets can be created for S-57 update files, but these update files cannot be decoded to models.The default implementation delegates to
getDataSourceModelDecoderFactory().canDecodeSource(aSource)
and ignoresaOtherAssetMetadatas
.This method is typically called by the LuciadFusion API user. In order to fuse data, you need to create and pass
ALfnAssetMetadata
instances to LuciadFusion. Before you call thecreateAsset
methods, you need to call this method.- Overrides:
canCreateAsset
in classALfnFormat
- Parameters:
aSourceName
- the source to be testedaOtherAssetMetadatas
- a list of already existing asset metadatas which may be used by the format to deduce information for the new asset. May benull
or empty.- Returns:
true
if the given source can be decoded to an asset and/or model,false
otherwise.- See Also:
-
isModelOfFormat
Description copied from class:ALfnFormat
Checks whether a model is of this format.- Specified by:
isModelOfFormat
in classALfnFormat
- Parameters:
aModel
- the model- Returns:
true
if the given model is of this format,false
otherwise
-
getName
Warning: this method throws an exception and should not be called. You should find the actual format instead and use that name, and not the name of the composite format.
- Overrides:
getName
in classALfnFormat
- Returns:
- the name of this format, for example
"GeoTIFF"
-
toString
- Overrides:
toString
in classALfnFormat
-
getFormats
Returns a read-only list of the registered engine formats.- Returns:
- the engine formats
-
addFormat
Adds an engine format. The engine format is added before all other formats, so it will be considered more important than any existing formats. If the specified format has a gxy layer factory, it should be able to create a layer for all models that are of its format according to ALfnFormat.isModelOfFormat(com.luciad.model.ILcdModel). Similarly, if the specified format has a height provider factory, it should be able to a create height provider for all models that are of its format.- Parameters:
aFormat
- the format
-
addFormats
Adds a list of engine formats. The engine formats are added before all other formats, so they will be considered more important than any existing formats.- Parameters:
aFormats
- a list of formats- See Also:
-
removeFormat
Removes an engine format- Parameters:
aFormat
- the format
-
removeFormats
Removes multiple engine formats.- Parameters:
aFormats
- multiple formats to unregister
-
createAsset
Description copied from class:ALfnFormat
Creates an asset for a given model. This method is typically only called when you already have an
ILcdModel
available. If the model does not yet exists, the recommended way is to use theALfnFormat.createAsset(String, java.util.List)
method instead.The implementation of this method has to set all the properties of the asset, notably:
- ALfnResourceMetadata.Builder.id(String): a unique id
- ALfnAssetMetadata.Builder.type(ELfnDataType): the native type of the data
- ALfnAssetMetadata.Builder.supportedCoverageTypes(ELfnDataType...): the types of coverages for which this asset can be used. Most commonly, the source asset data type and target coverage data types match, but this does not need to be the case. For example, ECDIS has
VECTOR
as (source) asset data type, but currently only supports fusion to a target coverage with data typeIMAGE
. - TLfnVectorAssetMetadata.Builder.dataModel(TLcdDataModel): the data model associated with the (vector) asset
- TLfnVectorAssetMetadata.VectorAssetPart.getScaleDenominator(): the scale associated with the (vector) asset part, if known
- TLfnRasterAssetMetadata.RasterAssetPart.getPixelDensity(): the pixel density of the (raster) asset part
This method is typically called by the LuciadFusion API user. In order to fuse data, you need to create and pass
ALfnAssetMetadata
instances to LuciadFusion. The creation of those assets is done by calling this method.- Specified by:
createAsset
in classALfnFormat
- Parameters:
aModel
- a model to create an asset for- Returns:
- the asset, or
null
if the model is not supported - See Also:
-
createAsset
public ALfnAssetMetadata createAsset(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) throws IOException Description copied from class:ALfnFormat
Creates an asset for a given source name.
The list of other asset metadatas that is provided may be used by the format to compute asset information which is not available in
aSourceName
itself, but can only be deduced using information from other, already existing assets. A typical example is an update asset for an existing base asset, which is not self-describing but can only be interpreted in combination with the base asset. The source name would point to the update asset, while the base asset must be in the list of other assets. You may for example useALfnTileStore.query(com.luciad.fusion.tilestore.ELfnResourceType)
to get the existing asset metadatas of a Tile Store. It is not possible to decode a stand-alone model from the update asset, it can only exist in combination with its base asset.The default implementation will use the model decoder factory to create an
ILcdModel
for the source, and pass that model to theALfnFormat.createAsset(com.luciad.model.ILcdModel)
method. The default implementation makes no use of theaOtherAssetMetadatas
parameter.The format has to set all the properties of the asset, notably:
- ALfnResourceMetadata.Builder.id(String): a unique id
- ALfnAssetMetadata.Builder.type(ELfnDataType): the native type of the data
- ALfnAssetMetadata.Builder.supportedCoverageTypes(ELfnDataType...): the types of coverages for which this asset can be used. Most commonly, the source asset data type and target coverage data types match, but this does not need to be the case. For example, ECDIS has
VECTOR
as (source) asset data type, but currently only supports fusion to a target coverage with data typeIMAGE
. - TLfnVectorAssetMetadata.Builder.dataModel(TLcdDataModel): the data model associated with the (vector) asset
- TLfnVectorAssetMetadata.VectorAssetPart.getScaleDenominator(): the scale associated with the (vector) asset part, if known
- TLfnRasterAssetMetadata.RasterAssetPart.getPixelDensity(): the pixel density of the (raster) asset part
This method is typically called by the LuciadFusion API user. In order to fuse data, you need to create and pass
ALfnAssetMetadata
instances to LuciadFusion. The creation of those assets is done by calling this method.- Overrides:
createAsset
in classALfnFormat
- Parameters:
aSourceName
- The source nameaOtherAssetMetadatas
- a list of already existing asset metadatas which may be used by the format to deduce information for the new asset. May benull
or empty.- Returns:
- the asset, or
null
if the source file is not supported - Throws:
IOException
- any IO exception which occurs in the model decoder during the decoding of the model- See Also:
-
isAssetSourcesInTileStoreSupported
Indicates if a format matching the given name exists and supports asset sources in Tile Store.- Parameters:
aFormatName
- a format name- Returns:
- if a format matching the given name exists and supports asset sources in Tile Store
- Since:
- 2013.1
-
isAssetOfFormat
Description copied from class:ALfnFormat
Returns
true
whenaAssetMetadata
was created by thisALfnFormat
,false
otherwise. This method might be called often, hence need to return quickly.The default implementation relies on the result of the
ALfnAssetMetadata.getFormat()
method. When the format name is not specified in the asset, a (slower) fallback mechanism is used. Therefore it is recommended to make sure the format name is specified in the assets, although it is optional.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself. In most use-cases where you need access to an
ALfnFormat
, you can use theTLfnCompositeFormat
and work against the composite instance, without having to bother whichALfnFormat
corresponded to which asset (part).- Overrides:
isAssetOfFormat
in classALfnFormat
- Parameters:
aAssetMetadata
- The asset- Returns:
true
whenaAssetMetadata
was created by thisAlfnFormat
,false
otherwise
-
isAssetPartOfFormat
Description copied from class:ALfnFormat
Returns
true
whenaAssetPart
was created by thisALfnFormat
,false
otherwise. This method might be called often, hence need to return quickly.The default implementation relies on the result of the
ALfnAssetMetadata.getFormat()
method. When the format name is not specified in the asset part, a (slower) fallback mechanism is used. Therefore it is recommended to make sure the format name is specified in the asset parts, although it is optional.Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself. In most use-cases where you need access to an
ALfnFormat
, you can use theTLfnCompositeFormat
and work against the composite instance, without having to bother whichALfnFormat
corresponded to which asset (part).- Overrides:
isAssetPartOfFormat
in classALfnFormat
- Parameters:
aAssetPart
- The asset part- Returns:
true
whenaAssetPart
was created by thisALfnFormat
,false
otherwise
-
retrieveFormatOf
Utility method which loops over all registeredALfnFormat
instances and returns the first format which returnstrue
forALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)
- Parameters:
aAssetMetadata
- The asset- Returns:
- The first of the registered formats which returns
true
forALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)
foraAssetMetadata
, ornull
when no such format can be found. - Since:
- 2014.0
-
getDataSourceModelDecoderFactory().canDecodeSource(aSource)
.