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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFormat(ALfnFormat aFormat) Adds an engine format.voidaddFormats(List<ALfnFormat> aFormats) Adds a list of engine formats.booleancanCreateAsset(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) Returnsfalsewhen the format is certain it cannot create an asset for the given source,trueotherwise.booleanDeprecated.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 anILcdDataSourcewhich represents allAssetPartinstances 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 StringgetName()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 allAssetPartinstances into groups.booleanisAssetOfFormat(ALfnAssetMetadata aAssetMetadata) ReturnstruewhenaAssetMetadatawas created by thisALfnFormat,falseotherwise.booleanisAssetPartOfFormat(ALfnAssetMetadata.AssetPart aAssetPart) ReturnstruewhenaAssetPartwas created by thisALfnFormat,falseotherwise.booleanisAssetSourcesInTileStoreSupported(String aFormatName) Indicates if a format matching the given name exists and supports asset sources in Tile Store.booleanisModelOfFormat(ILcdModel aModel) Checks whether a model is of this format.voidremoveFormat(ALfnFormat aFormat) Removes an engine formatvoidremoveFormats(Collection<ALfnFormat> aFormats) Removes multiple engine formats.final ALfnFormatretrieveFormatOf(ALfnAssetMetadata aAssetMetadata) Utility method which loops over all registeredALfnFormatinstances and returns the first format which returnstrueforALfnFormat.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:ALfnFormatGets 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 regularILcdGXYLayerFactoryis.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:
getSLDGXYLayerFactoryin classALfnFormat- Returns:
- a layer factory, possibly
null
-
getGXYLayerFactory
Description copied from class:ALfnFormatGets 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 factorymethod. The recommended way to replace the layer factory of a format is to override theALfnFormat.getSLDGXYLayerFactory()method.- Overrides:
getGXYLayerFactoryin classALfnFormat- Returns:
- a GXY layer factory, possibly
null
-
getHeightProviderFactory
Description copied from class:ALfnFormatGets 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:
getHeightProviderFactoryin classALfnFormat- Returns:
- a height provider factory, possibly
null
-
getIdentityProviderFactory
Description copied from class:ALfnFormatGets 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:
getIdentityProviderFactoryin classALfnFormat- Returns:
- a feature ID provider factory, possibly
null
-
getDataSourceModelDecoderFactory
Description copied from class:ALfnFormatGets 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:
getDataSourceModelDecoderFactoryin classALfnFormat- Returns:
- a data source model decoder factory, never
null
-
groupAssetPartsForDataSources
public List<List<ALfnAssetMetadata.AssetPart>> groupAssetPartsForDataSources(List<ALfnAssetMetadata> aAssetMetadatas) Description copied from class:ALfnFormatThis method is responsible for grouping all
AssetPartinstances into groups. For each of those groups, anILcdDataSourcewill 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
AssetParts 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 anILcdDataSourceand pass it to the model decoder.This method indicates to the fusion process whichAssetParts needs to be grouped together when anILcdDataSourceis created. When this method groups theAssetParts 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 anILcdDataSourcerepresenting 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:
groupAssetPartsForDataSourcesin classALfnFormat- Parameters:
aAssetMetadatas- All theALfnAssetMetadatainstances available in the coverage.- Returns:
- A
Listcontaining groups ofAssetPartinstances (where a group is represented by aListas well). EachAssetPartgroup will be passed to theALfnFormat.createDataSource(java.util.List)method to create anILcdDataSource.
-
createDataSource
Description copied from class:ALfnFormatThis method is responsible for creating an
ILcdDataSourcewhich represents allAssetPartinstances inaAssetPartsGroup. WhichAssetPartinstances are contained inaAssetPartsGroupis determined by the result of theALfnFormat.groupAssetPartsForDataSources(java.util.List)method.The default implementation of this method creates
ILcdDataSourceinstances 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:
createDataSourcein classALfnFormat- Parameters:
aGroupedAssetParts- A group ofAssetPartinstances for which anILcdDataSourcemust be created. AllAssetPartinstances should have been created by this format.- Returns:
- An
ILcdDataSourcerepresenting allAssetParts 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:
trueif the model decoder factory can decoderaSource
-
canCreateAsset
Description copied from class:ALfnFormatReturns
falsewhen the format is certain it cannot create an asset for the given source,trueotherwise. 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
aSourceitself, 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
truedoes 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
ALfnAssetMetadatainstances to LuciadFusion. Before you call thecreateAssetmethods, you need to call this method.- Overrides:
canCreateAssetin 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 benullor empty.- Returns:
trueif the given source can be decoded to an asset and/or model,falseotherwise.- See Also:
-
isModelOfFormat
Description copied from class:ALfnFormatChecks whether a model is of this format.- Specified by:
isModelOfFormatin classALfnFormat- Parameters:
aModel- the model- Returns:
trueif the given model is of this format,falseotherwise
-
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:
getNamein classALfnFormat- Returns:
- the name of this format, for example
"GeoTIFF"
-
toString
- Overrides:
toStringin 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:ALfnFormatCreates an asset for a given model. This method is typically only called when you already have an
ILcdModelavailable. 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
VECTORas (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
ALfnAssetMetadatainstances to LuciadFusion. The creation of those assets is done by calling this method.- Specified by:
createAssetin classALfnFormat- Parameters:
aModel- a model to create an asset for- Returns:
- the asset, or
nullif the model is not supported - See Also:
-
createAsset
public ALfnAssetMetadata createAsset(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) throws IOException Description copied from class:ALfnFormatCreates 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
aSourceNameitself, 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
ILcdModelfor the source, and pass that model to theALfnFormat.createAsset(com.luciad.model.ILcdModel)method. The default implementation makes no use of theaOtherAssetMetadatasparameter.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
VECTORas (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
ALfnAssetMetadatainstances to LuciadFusion. The creation of those assets is done by calling this method.- Overrides:
createAssetin 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 benullor empty.- Returns:
- the asset, or
nullif 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:ALfnFormatReturns
truewhenaAssetMetadatawas created by thisALfnFormat,falseotherwise. 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 theTLfnCompositeFormatand work against the composite instance, without having to bother whichALfnFormatcorresponded to which asset (part).- Overrides:
isAssetOfFormatin classALfnFormat- Parameters:
aAssetMetadata- The asset- Returns:
truewhenaAssetMetadatawas created by thisAlfnFormat,falseotherwise
-
isAssetPartOfFormat
Description copied from class:ALfnFormatReturns
truewhenaAssetPartwas created by thisALfnFormat,falseotherwise. 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 theTLfnCompositeFormatand work against the composite instance, without having to bother whichALfnFormatcorresponded to which asset (part).- Overrides:
isAssetPartOfFormatin classALfnFormat- Parameters:
aAssetPart- The asset part- Returns:
truewhenaAssetPartwas created by thisALfnFormat,falseotherwise
-
retrieveFormatOf
Utility method which loops over all registeredALfnFormatinstances and returns the first format which returnstrueforALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)- Parameters:
aAssetMetadata- The asset- Returns:
- The first of the registered formats which returns
trueforALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)foraAssetMetadata, ornullwhen no such format can be found. - Since:
- 2014.0
-
getDataSourceModelDecoderFactory().canDecodeSource(aSource).