Package com.luciad.fusion.engine.format
Class TLfnFormat
java.lang.Object
com.luciad.fusion.engine.format.ALfnFormat
com.luciad.fusion.engine.format.TLfnFormat
Default implementation of ALfnFormat.
This class provides an implementation of the
createAsset()
method which provides good defaults for most
formats.
It supports all format types (image, elevation, vector).
It creates assets with the following information:
- asset id: a random UUID
- name: the model descriptor's display name
- type: the provided data type
- georeference: the georeference of the model. Model tree nodes with different model references are not supported.
- asset parts: for vector data, a single asset part is created with the bounds of the model. For other data, an asset part is created per raster, each with the bounds of their raster.
getScaleDenominator(com.luciad.model.ILcdModel)
method (the default returns the unknown scale denominator). For other data, the pixel density of the raster is used.- Since:
- 2012.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
ConstructorDescriptionTLfnFormat
(ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.TLfnFormat
(String aFormatId, ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.TLfnFormat
(String aFormatId, ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format with given parameters.TLfnFormat
(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.TLfnFormat
(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.TLfnFormat
(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format with given parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateAsset
(ILcdModel aModel) Creates an asset for a given model.protected int
getScaleDenominator
(ILcdModel aModel) Returns the scale denominator for the compilation (native) scale for the given model.boolean
isModelOfFormat
(ILcdModel aModel) Checks whether a model is of this format.Methods inherited from class com.luciad.fusion.engine.format.ALfnFormat
canCreateAsset, createAsset, createDataSource, createDefaultFormats, getDataSourceModelDecoderFactory, getGXYLayerFactory, getHeightProviderFactory, getIdentityProviderFactory, getModelDecoderFactory, getName, getSLDGXYLayerFactory, groupAssetPartsForDataSources, isAssetOfFormat, isAssetPartOfFormat, isAssetSourcesInTileStoreSupported, newElevationFormat, newElevationFormat, newImageFormat, newImageFormat, newVectorFormat, newVectorFormat, toString
-
Constructor Details
-
TLfnFormat
public TLfnFormat(ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.- Parameters:
aModelDecoderFactory
- the model decoder factory, the name of which will be taken as the format IDaGXYLayerFactory
- the GXY layer factoryaHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which is ignored since the format auto-detects the type from the model. It is safe to usenull
here.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any
-
TLfnFormat
public TLfnFormat(String aFormatId, ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format with given parameters. If the GXY layer factory is notnull
, an SLD GXY layer factory adapter will be created which ignores the styling. If you desire a specific styling for your format, you should instead use the other constructor which takes anILcdSLDGXYLayerFactory
.- Parameters:
aFormatId
- the unique identifier for this format, this should never changeaModelDecoderFactory
- the model decoder factoryaGXYLayerFactory
- the GXY layer factory, which may benull
to indicate that assets of this format cannot be fused toIMAGE
coveragesaHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which is ignored since the format auto-detects the type from the model. It is safe to usenull
here.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any- See Also:
-
TLfnFormat
public TLfnFormat(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format with given parameters. If the GXY layer factory is notnull
, an SLD GXY layer factory adapter will be created which ignores the styling. If you desire a specific styling for your format, you should instead use the other constructor which takes anILcdSLDGXYLayerFactory
. Note that you need to override theALfnFormat.createDataSource(java.util.List)
as well. The default implementation of that method createsILcdDataSource
instances which will not be accepted by the model decoder factory.- Parameters:
aFormatId
- the unique identifier for this format, this should never changeaModelDecoderFactory
- the model decoder factoryaGXYLayerFactory
- the GXY layer factory, which may benull
to indicate that assets of this format cannot be fused toIMAGE
coveragesaHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which is ignored since the format auto-detects the type from the model. It is safe to usenull
here.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any- Since:
- 2014.0
- See Also:
-
TLfnFormat
public TLfnFormat(String aFormatId, ILcdEarthModelDecoderFactory aModelDecoderFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format.- Parameters:
aFormatId
- the unique identifier for this format, this should never changeaModelDecoderFactory
- the model decoder factoryaSLDGXYLayerFactory
- the SLD GXY layer factoryaHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which may benull
to indicate that the format should figure out the data type from the model on a per model basis. If unsure, usenull
.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any
-
TLfnFormat
public TLfnFormat(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format. Note that you need to override theALfnFormat.createDataSource(java.util.List)
as well. The default implementation of that method createsILcdDataSource
instances which will not be accepted by the model decoder factory.- Parameters:
aFormatId
- the unique identifier for this format, this should never changeaModelDecoderFactory
- the model decoder factoryaSLDGXYLayerFactory
- the SLD GXY layer factoryaHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which may benull
to indicate that the format should figure out the data type from the model on a per model basis. If unsure, usenull
.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any- Since:
- 2014.0
-
TLfnFormat
public TLfnFormat(String aFormatId, ILfnDataSourceModelDecoderFactory aModelDecoderFactory, ILcdGXYLayerFactory aGXYLayerFactory, ILcdSLDGXYLayerFactory aSLDGXYLayerFactory, ILcdModelHeightProviderFactory aHeightProviderFactory, ILfnIdentityProviderFactory aFeatureIdProviderFactory, ELfnDataType aType, String aModelDescriptorTypeName, Class<? extends ILcdModelDescriptor>... aModelDescriptorClasses) Creates a new engine format. Note that you need to override theALfnFormat.createDataSource(java.util.List)
as well. The default implementation of that method createsILcdDataSource
instances which will not be accepted by the model decoder factory.- Parameters:
aFormatId
- the unique identifier for this format, this should never changeaModelDecoderFactory
- the model decoder factoryaGXYLayerFactory
- the GXY layer factory. If also an ILcdGXYLayerFactory is supplied, this layer factory is used as fallback. Can benull
ifaSLDGXYLayerFactory
is notnull
.aSLDGXYLayerFactory
- the SLD GXY layer factory. Can benull
ifaGXYLayerFactory
is notnull
.aHeightProviderFactory
- the height provider factory, may benull
if not supportedaFeatureIdProviderFactory
- the feature ID provider factory for vector data , may benull
if not supportedaType
- the data type, which may benull
to indicate that the format should figure out the data type from the model on a per model basis. If unsure, usenull
.aModelDescriptorTypeName
- the type name of the model descriptor ornull
for anyaModelDescriptorClasses
- the possible classes of the model descriptor or none for any- Since:
- 2017.0
-
-
Method Details
-
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:
-
getScaleDenominator
Returns the scale denominator for the compilation (native) scale for the given model. The default implementation estimates the scale based on the model's bounds. It uses a world scale of 1:50000000 for model bounds that span the whole world. Other model bounds are estimated relative to this world scale. A model with bounds covering the whole world will for example have an estimated scale of 1:50000000. A model with bounds covering only a quarter of the world will have an estimated scale of 1:25000000. The default implementation can only provide an estimate, because there is generally no information available in the model to do better. Specific formats, such as S-57 and DGN, may rely on specific information available in the model, resulting in an accurate scale denominator.- Parameters:
aModel
- the model for which to determine the compilation scale denominator- Returns:
- the compilation scale denominator of the given model
-
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
-