public class TLfnCompositeFormat extends 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 and Description |
---|
TLfnCompositeFormat()
Creates an empty composite factory.
|
Modifier and Type | Method and Description |
---|---|
void |
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)
Returns
false when the format is certain it cannot create an asset for the given source,
true otherwise. |
boolean |
canDecode(String aSource)
Deprecated.
If you want to know whether the model decoder factory can decode the specified source, you can
use
getDataSourceModelDecoderFactory().canDecodeSource(aSource) . If you want to know whether an asset can
be created for aSource , you can use the canCreateAsset(String, java.util.List) method. |
ALfnAssetMetadata |
createAsset(ILcdModel aModel)
Creates an asset for a given model.
|
ALfnAssetMetadata |
createAsset(String aSourceName,
List<ALfnAssetMetadata> aOtherAssetMetadatas)
Creates an asset for a given source name.
|
ILcdDataSource |
createDataSource(List<ALfnAssetMetadata.AssetPart> aGroupedAssetParts)
This method is responsible for creating an
ILcdDataSource which represents all AssetPart
instances in aAssetPartsGroup . |
ILfnDataSourceModelDecoderFactory |
getDataSourceModelDecoderFactory()
Gets the data source model decoder factory of this format.
|
List<ALfnFormat> |
getFormats()
Returns a read-only list of the registered engine formats.
|
ILcdGXYLayerFactory |
getGXYLayerFactory()
Gets the GXY layer factory of this format, if any.
|
ILcdModelHeightProviderFactory |
getHeightProviderFactory()
Gets the height provider factory of this format, if any.
|
ILfnIdentityProviderFactory |
getIdentityProviderFactory()
Gets the (vector) feature ID provider factory of this format, if any.
|
String |
getName()
Warning: this method throws an exception and should not be called.
|
ILcdSLDGXYLayerFactory |
getSLDGXYLayerFactory()
Gets the SLD GXY layer factory of this format, if any.
|
List<List<ALfnAssetMetadata.AssetPart>> |
groupAssetPartsForDataSources(List<ALfnAssetMetadata> aAssetMetadatas)
This method is responsible for grouping all
AssetPart
instances into groups. |
boolean |
isAssetOfFormat(ALfnAssetMetadata aAssetMetadata)
Returns
true when aAssetMetadata was created by this ALfnFormat , false
otherwise. |
boolean |
isAssetPartOfFormat(ALfnAssetMetadata.AssetPart aAssetPart)
Returns
true when aAssetPart was created by this ALfnFormat , 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 format
|
void |
removeFormats(Collection<ALfnFormat> aFormats)
Removes multiple engine formats.
|
ALfnFormat |
retrieveFormatOf(ALfnAssetMetadata aAssetMetadata)
Utility method which loops over all registered
ALfnFormat instances and returns
the first format which returns true for ALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata) |
String |
toString() |
createDefaultFormats, getModelDecoderFactory, isAssetSourcesInTileStoreSupported, newElevationFormat, newElevationFormat, newImageFormat, newImageFormat, newVectorFormat, newVectorFormat
public TLfnCompositeFormat()
public ILcdSLDGXYLayerFactory getSLDGXYLayerFactory()
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 returns null
,
it will not be possible to fuse as IMAGE
.
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 regular ILcdGXYLayerFactory
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.
getSLDGXYLayerFactory
in class ALfnFormat
null
public ILcdGXYLayerFactory getGXYLayerFactory()
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 returns null
,
it will not be possible to fuse as IMAGE
(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 the ALfnFormat.getSLDGXYLayerFactory()
method.
getGXYLayerFactory
in class ALfnFormat
null
public ILcdModelHeightProviderFactory getHeightProviderFactory()
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 returns null
,
it will not be possible to fuse as ELEVATION
(see class javadoc).
Typically you do not need to call this method yourself. It is mainly here for LuciadFusion itself.
getHeightProviderFactory
in class ALfnFormat
null
public ILfnIdentityProviderFactory getIdentityProviderFactory()
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 returns null
,
it will not be possible to fuse as VECTOR
(see class javadoc).
getIdentityProviderFactory
in class ALfnFormat
null
public ILfnDataSourceModelDecoderFactory getDataSourceModelDecoderFactory()
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 the ALfnFormat.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.
getDataSourceModelDecoderFactory
in class ALfnFormat
null
public List<List<ALfnAssetMetadata.AssetPart>> groupAssetPartsForDataSources(List<ALfnAssetMetadata> aAssetMetadatas)
ALfnFormat
This method is responsible for grouping all AssetPart
instances into groups. For each of those groups, an ILcdDataSource
will be created by calling the ALfnFormat.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 an ILcdModel
(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 an ILcdDataSource
and pass it to the model decoder.This method
indicates to the fusion process which AssetPart
s needs to be grouped together when an {@code ILcdDataSource} is created.
When this method groups the AssetPart
s representing the update file(s) together with the ones corresponding to the base files, they
will be passed as one group to the ALfnFormat.createDataSource(java.util.List)
method which allows to create an
ILcdDataSource
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 custom ALfnFormat.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.
groupAssetPartsForDataSources
in class ALfnFormat
aAssetMetadatas
- All the ALfnAssetMetadata
instances available in the coverage.List
containing groups of AssetPart
instances (where a group is represented by a List
as well). Each AssetPart
group will be passed to the ALfnFormat.createDataSource(java.util.List)
method to create
an ILcdDataSource
.public ILcdDataSource createDataSource(List<ALfnAssetMetadata.AssetPart> aGroupedAssetParts)
ALfnFormat
This method is responsible for creating an ILcdDataSource
which represents all AssetPart
instances in aAssetPartsGroup
. Which AssetPart
instances are contained in aAssetPartsGroup
is determined by the result of the ALfnFormat.groupAssetPartsForDataSources(java.util.List)
method.
The default implementation of this method creates ILcdDataSource
instances which are accepted by the
default ILfnDataSourceModelDecoderFactory
. If you used a constructor
which accepts a custom ILfnDataSourceModelDecoderFactory
, or you have overridden the
ALfnFormat.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 the ALfnFormat.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.
createDataSource
in class ALfnFormat
aGroupedAssetParts
- A group of AssetPart
instances for which an ILcdDataSource
must be created.
All AssetPart
instances should have been created by this format.ILcdDataSource
representing all AssetPart
s contained in aAssetPartsGroup
public boolean canDecode(String aSource)
getDataSourceModelDecoderFactory().canDecodeSource(aSource)
. If you want to know whether an asset can
be created for aSource
, you can use the canCreateAsset(String, java.util.List)
method.aSource
- the sourcetrue
if the model decoder factory can decoder aSource
public boolean canCreateAsset(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas)
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
ignores aOtherAssetMetadatas
.
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 the createAsset
methods, you need
to call this method.
canCreateAsset
in class ALfnFormat
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 be null
or empty.true
if the given source can be decoded to an asset and/or model, false
otherwise.ALfnFormat.createAsset(String, java.util.List)
public boolean isModelOfFormat(ILcdModel aModel)
ALfnFormat
isModelOfFormat
in class ALfnFormat
aModel
- the modeltrue
if the given model is of this format, false
otherwisepublic final String 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.
getName
in class ALfnFormat
"GeoTIFF"
public String toString()
toString
in class ALfnFormat
public List<ALfnFormat> getFormats()
public void addFormat(ALfnFormat aFormat)
aFormat
- the formatpublic void addFormats(List<ALfnFormat> aFormats)
aFormats
- a list of formatsaddFormat(com.luciad.fusion.engine.format.ALfnFormat)
public void removeFormat(ALfnFormat aFormat)
aFormat
- the formatpublic void removeFormats(Collection<ALfnFormat> aFormats)
aFormats
- multiple formats to unregisterpublic ALfnAssetMetadata createAsset(ILcdModel aModel)
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 the
ALfnFormat.createAsset(String, java.util.List)
method instead.
The implementation of this method has to set all the properties of the asset, notably:
VECTOR
as (source) asset data type, but currently only supports fusion to a target coverage with data type IMAGE
. 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.
createAsset
in class ALfnFormat
aModel
- a model to create an asset fornull
if the model is not supportedALfnFormat.createAsset(String, java.util.List)
public ALfnAssetMetadata createAsset(String aSourceName, List<ALfnAssetMetadata> aOtherAssetMetadatas) throws IOException
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 use ALfnTileStore.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 the ALfnFormat.createAsset(com.luciad.model.ILcdModel)
method. The default implementation makes no use
of the aOtherAssetMetadatas
parameter.
The format has to set all the properties of the asset, notably:
VECTOR
as (source) asset data type, but currently only supports fusion to a target coverage with data type IMAGE
. 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.
createAsset
in class ALfnFormat
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 be null
or empty.null
if the source file is not supportedIOException
- any IO exception which occurs in the model decoder during the decoding of the modelALfnFormat.createAsset(com.luciad.model.ILcdModel)
public boolean isAssetSourcesInTileStoreSupported(String aFormatName)
aFormatName
- a format namepublic boolean isAssetOfFormat(ALfnAssetMetadata aAssetMetadata)
ALfnFormat
Returns true
when aAssetMetadata
was created by this ALfnFormat
, 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 the TLfnCompositeFormat
and work against the composite instance,
without having to bother which ALfnFormat
corresponded to which asset (part).
isAssetOfFormat
in class ALfnFormat
aAssetMetadata
- The assettrue
when aAssetMetadata
was created by this AlfnFormat
, false
otherwisepublic boolean isAssetPartOfFormat(ALfnAssetMetadata.AssetPart aAssetPart)
ALfnFormat
Returns true
when aAssetPart
was created by this ALfnFormat
, 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 the TLfnCompositeFormat
and work against the composite instance,
without having to bother which ALfnFormat
corresponded to which asset (part).
isAssetPartOfFormat
in class ALfnFormat
aAssetPart
- The asset parttrue
when aAssetPart
was created by this ALfnFormat
, false
otherwisepublic final ALfnFormat retrieveFormatOf(ALfnAssetMetadata aAssetMetadata)
ALfnFormat
instances and returns
the first format which returns true
for ALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)
aAssetMetadata
- The assettrue
for
ALfnFormat.isAssetOfFormat(com.luciad.fusion.tilestore.metadata.ALfnAssetMetadata)
for
aAssetMetadata
, or null
when no such format can be found.