Class TLfnEngineFactory
- Direct Known Subclasses:
TLfnLFSEngineFactory
A factory class for ALfnEngine
instances which perform the fusion on the
local system. Engines can be created using the createEngine(com.luciad.fusion.tilestore.ALfnTileStore, String)
method.
The engines created by this factory will perform the fusion on the local system. The target tile store
can be either local or remote. If you want to do the fusion on a remote system (the same system as the
tile store, or another system), you should use the TLfnLFSEngineFactory
class.
Example lifecycle:
- Use
createEngine
to create a new engine. You cannot create an engine if one already exists. UsegetEngines()
to see if an engine is already running. - Use
ALfnEngine.fuse(com.luciad.fusion.util.ILfnCallback<java.lang.Void>)
to start fusing. You can call this method more than once on the same engine. - Use
ALfnEngine.stop()
to stop the fusion process, if necessary. - Use
removeEngine(com.luciad.fusion.engine.ALfnEngine)
to remove the engine from the list of open engines.
- Since:
- 10.0
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Deprecated.Sessions are not necessary anymore to create engines.static enum
The tile combining strategy defines how values of 4 tiles at levelN
are combined into values of 1 tile at levelN - 1
.class
Deprecated.Sessions are not necessary anymore to create engines. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int[]
Deprecated.useTLfnRasterCoverageMetadata.ALL_LEVELS
instead (since 2013.0) -
Constructor Summary
ConstructorDescriptionConstructs an engine factory using the default engine environment and tile store provider.TLfnEngineFactory
(ALfnEngineEnvironment aEngineEnvironment) Constructs an engine factory using a given engine environment and the default tile store provider.TLfnEngineFactory
(ALfnEngineEnvironment aEngineEnvironment, ALfnTileStoreProvider aTileStoreProvider) Constructs an engine factory using a given engine environment and tile store provider. -
Method Summary
Modifier and TypeMethodDescriptioncreateEngine
(ALfnTileStore aTileStore, ILfnEngineSession aSession) Deprecated.UsecreateEngine(ALfnTileStore, String)
instead (since 2013.0)createEngine
(ALfnTileStore aTileStore, String aCoverageID) Creates a fusion engine for a coverage.Gets the open engines managed by this instance.Deprecated.Sessions are not necessary anymore to create engines.Deprecated.Sessions are not necessary anymore to create engines.boolean
removeEngine
(ALfnEngine aEngine) Removes an open engine.
-
Field Details
-
ALL_LEVELS
Deprecated.useTLfnRasterCoverageMetadata.ALL_LEVELS
instead (since 2013.0)
-
-
Constructor Details
-
TLfnEngineFactory
public TLfnEngineFactory(ALfnEngineEnvironment aEngineEnvironment, ALfnTileStoreProvider aTileStoreProvider) Constructs an engine factory using a given engine environment and tile store provider. The tile store provider is used to create master tile stores from URIs.- Parameters:
aEngineEnvironment
- the engine environment, which may benull
to use the internal defaultaTileStoreProvider
- a tile store provider, which may benull
to use the internal default- Since:
- 2015.0
-
TLfnEngineFactory
Constructs an engine factory using a given engine environment and the default tile store provider.- Parameters:
aEngineEnvironment
- the engine environment, which may benull
to use the internal default
-
TLfnEngineFactory
public TLfnEngineFactory()Constructs an engine factory using the default engine environment and tile store provider. The default engine environment will be closed on finalization, and has the following properties:- It supports the default formats as described in
ALfnFormat.createDefaultFormats(ALfnEngineEnvironment)
. - It uses all available CPU cores.
- It supports file system master tile stores of the form
file:///mnt/LuciadFusion/tile-store.xml
or/mnt/LuciadFusion/tile-store.xml
. - It supports remote master tile stores of the form
http://hostname:8081/LuciadFusion/lts
.
- Since:
- 2014.0
- It supports the default formats as described in
-
-
Method Details
-
newRasterSessionBuilder
Deprecated.Sessions are not necessary anymore to create engines. Seemigration details
. (since 2013.0)Creates a session builder for fusing raster assets to a raster coverage.The following properties must be set before a session can be built:
- Tile Store
- Target coverage metadata
- Source asset metadatas
- Returns:
- a raster session builder
- Since:
- 11.0
-
newVectorSessionBuilder
Deprecated.Sessions are not necessary anymore to create engines. Seemigration details
. (since 2013.0)Creates a session builder for fusing vector assets to a vector coverage.For vector data it is important to provide a multi-leveling geometry and simplification policy. The policy should ensure that the data density decreases as the levels get less detailed. This should be done by leaving out features and by simplifying the geometry of features sufficiently at less detailed levels.
The following properties must be set before a session can be built:
- Tile Store
- Target coverage metadata
- Source asset metadatas
It is also highly recommended to set a geometry provider specific for your use case and enable simplification.
By default a fail-fast session handler is used, which will make the fusion abort on the first error.
- Returns:
- a vector session builder
- Since:
- 11.0
-
getEngines
Gets the open engines managed by this instance.- Returns:
- The open engines
- Throws:
IOException
TLfnServiceException
- Since:
- 2013.0
- See Also:
-
createEngine
@Deprecated public ALfnEngine createEngine(ALfnTileStore aTileStore, ILfnEngineSession aSession) throws IOException, TLfnServiceException Deprecated.UsecreateEngine(ALfnTileStore, String)
instead (since 2013.0)You can configure most options of
raster
orvector
sessions on the coverage metadata, which eases the setup, and makes it persistent.Common options:
assets
->
ALfnCoverageMetadata.Builder.assetInfos(ALfnCoverageMetadata.AssetInfo...)
asset order
->
TLfnRasterCoverageMetadata.Builder.preserveAssetOrder()
session handler
->
ALfnCoverageMetadata.Builder.ignoreNonFatalFailures()
andALfnEngine.addSessionHandler(com.luciad.fusion.engine.raster.ILfnRasterSessionHandler)
Raster options:
Vector options:
Creates a fusion engine for a coverage. Creation of an engine will validate the session parameters against a number of constraints, throwing anIllegalArgumentException
upon violation. The constraints are:- The parameters must not be
null
- The pixel density or scale of assets must be defined
- The source assets must be compatible with the data type of the target coverage
- The tile data codec and tile combiner must be compatible with the tile format
- The level-0 row count and column count must be (strictly) greater then 0
- The properties of an asset must match those of the existing asset:
- geo reference
- data type
- parts: location (URI), bounding box, pixel density/scale
- The properties of a coverage must match those of the existing coverage:
- geo reference
- level-0 row count and column count
- data type
- format
- bounding box
- The existing ordered list of assets must exactly match the head of the session's list of assets, with matching order and fusion status.
The session may have additional assets at the tail of the list which are not in the existing list.
There are 2 cases to be distinguished here:
- There are no additional assets at the tail of the session's list, it matches the existing list exactly. This corresponds to the use case of "resuming an ongoing fusion"
- There are additional assets at the tail of the session's list.
This corresponds to the use case of "adding additional assets on top of an existing coverage". There is an extra constraint in this case:
the existing list must not contain any assets with status
"INCOMPLETE"
. In other words, it is not allowed to add additional assets to an existing coverage as long as that coverage has not yet been fully fused
- Parameters:
aTileStore
- the LuciadFusion Tile Store that will host the coverageaSession
- the session information for the fusion- Returns:
- a new fusion engine
- Throws:
IOException
- if a connection could not be made to the engineTLfnServiceException
- if a failure happens on the remote engineIllegalArgumentException
- in case the session is inconsistent in some wayIllegalStateException
- if an engine for the given coverage already exists
-
createEngine
public ALfnEngine createEngine(ALfnTileStore aTileStore, String aCoverageID) throws IOException, TLfnServiceException Creates a fusion engine for a coverage. The target coverage and all of the source assets must exists in the Tile Store. Creation of an engine will validate a number of constraints, throwing anIllegalArgumentException
upon violation. The constraints are:- The parameters must not be
null
- The pixel density or scale of assets must be defined
- The source assets must be compatible with the data type of the target coverage
- The level-0 row count and column count must be (strictly) greater then 0
- Parameters:
aTileStore
- the LuciadFusion Tile Store that will host the coverageaCoverageID
- the id of the resource to fuse. The resource must exist in the Tile Store, otherwise- Returns:
- a new fusion engine
- Throws:
IOException
- if no connection could be made with the engineTLfnServiceException
- if a failure happens on the remote engineIllegalArgumentException
- in case the session is inconsistent in some way, or if no resource exists in the Tile Store for the given ID.IllegalStateException
- if an engine for the given coverage already exists
- The parameters must not be
-
removeEngine
Removes an open engine.- Parameters:
aEngine
- An engine, managed by this instance.- Returns:
true
if the engine existed, false otherwise.- Throws:
IOException
- if a connection could not be made to the engineTLfnServiceException
- if a failure happens on the remote engine- Since:
- 2013.0
- See Also:
-