Package com.luciad.earth.model
Class TLcdEarthRepositoryModelFactory
java.lang.Object
com.luciad.earth.model.TLcdEarthRepositoryModelFactory
A factory for models with a
TLcdEarthTileRepository
.
This factory will create all required files for a repository (ex. the database and the model
reference) and an empty asset model (see TLcdEarthTileRepository
for more information). The created models will contain 1 TLcdEarthTileRepository
element and have a ILcdEarthAssetBasedModelDescriptor
. This is also demonstrated in
the following snippet:
// Create the repository model ILcdModel repositoryModel = repositoryModelFactory.createRepository( "/path/to/my/repository" ); // Get the repository TLcdEarthTileRepository repository = ( TLcdEarthTileRepository ) repositoryModel.elements().nextElement(); // Get the asset model that describes the contents of the repository ILcdEarthAssetBasedModelDescriptor modelDescriptor = ( ILcdEarthAssetBasedModelDescriptor ) repositoryModel.getModelDescriptor(); ILcdModel repositoryAssetModel = modelDescriptor.getAssetModel( repository );If the asset model of a repository model created by this factory is changed it can be saved by using its model encoder. This is also demonstrated in the following snippet:
ILcdModel repositoryAssetModel = ...; // the asset model that describes the contents of the repository // add/remove some assets to/from repositoryAssetModel // Save the asset model repositoryAssetModel.getModelEncoder().save( repositoryAssetModel );
- Since:
- 9.1
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a newTLcdEarthRepositoryModelFactory
with the default model reference encoder/decoder and asset codecs. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssetCodec
(ILcdEarthAssetCodec aCodec) Adds the specified asset codec.protected TLcdEarthTileRepository
createRepository
(String aRepositoryName, ILcdEarthTileSet aTileSet) Creates a new tile repository with the given name.createRepositoryModel
(String aSourceName) Create a new tile repository model that has a repository with the advised tile structure.createRepositoryModel
(String aSourceName, ILcdEarthTileSet aTileSet, ILcdModelReference aModelReference) Create a new tile repository model.Returns the current collection of asset codecs.boolean
removeAssetCodec
(ILcdEarthAssetCodec aCodec) Removes the specified asset codec.
-
Constructor Details
-
TLcdEarthRepositoryModelFactory
public TLcdEarthRepositoryModelFactory()Constructs a newTLcdEarthRepositoryModelFactory
with the default model reference encoder/decoder and asset codecs.
-
-
Method Details
-
addAssetCodec
Adds the specified asset codec.- Parameters:
aCodec
- the asset codec that should be added
-
removeAssetCodec
Removes the specified asset codec.- Parameters:
aCodec
- the asset codec that should be removed- Returns:
- true if a codec was remove; false otherwise
-
getAssetCodecs
Returns the current collection of asset codecs.- Returns:
- the current collection of asset codecs
-
createRepositoryModel
Create a new tile repository model that has a repository with the advised tile structure. This tile structure ensures optimal performance when used with Luciad products. More details on this can be found in the Earth developer guide. This method will create the repository, save its model reference and create an empty asset model to describe its contents. The repository should be configured (e.g. add tile data codecs and coverages) before it is used.- Parameters:
aSourceName
- the source name of the repository- Returns:
- a model with a repository that has the advised tile structure
- Throws:
IOException
- if an IO error occurs
-
createRepositoryModel
public ILcdModel createRepositoryModel(String aSourceName, ILcdEarthTileSet aTileSet, ILcdModelReference aModelReference) throws IOException Create a new tile repository model. The specified tileset defines the structure of the repository. If this tile structure is not compatible with the advised tile structure the performance of the repository may be lower when used with Luciad products. More details on this can be found in the Earth developer guide. This method will create the repository, save its model reference and create an empty asset model to describe its contents. The repository should be configured (e.g. add tile data codecs and coverages) before it is used.- Parameters:
aSourceName
- the source name of the repositoryaTileSet
- the tileset that will provide tiles to the repositoryaModelReference
- the model reference of the repository- Returns:
- a model with a repository
- Throws:
IOException
- if an IO error occurs- See Also:
-
createRepository
protected TLcdEarthTileRepository createRepository(String aRepositoryName, ILcdEarthTileSet aTileSet) throws IOException Creates a new tile repository with the given name. The default implementation creates aTLcdEarthTileRepository
instance.- Parameters:
aRepositoryName
- the name of the repository to openaTileSet
- the tileset that will provide tiles to this repository- Returns:
- a repository
- Throws:
IOException
- if the repository already exists or could not be created- See Also:
-