Class TLcdEarthRepositoryModelFactory

java.lang.Object
com.luciad.earth.model.TLcdEarthRepositoryModelFactory

public class TLcdEarthRepositoryModelFactory extends Object
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 Details

    • TLcdEarthRepositoryModelFactory

      public TLcdEarthRepositoryModelFactory()
      Constructs a new TLcdEarthRepositoryModelFactory with the default model reference encoder/decoder and asset codecs.
  • Method Details

    • addAssetCodec

      public void addAssetCodec(ILcdEarthAssetCodec aCodec)
      Adds the specified asset codec.
      Parameters:
      aCodec - the asset codec that should be added
    • removeAssetCodec

      public boolean removeAssetCodec(ILcdEarthAssetCodec aCodec)
      Removes the specified asset codec.
      Parameters:
      aCodec - the asset codec that should be removed
      Returns:
      true if a codec was remove; false otherwise
    • getAssetCodecs

      public Collection<ILcdEarthAssetCodec> getAssetCodecs()
      Returns the current collection of asset codecs.
      Returns:
      the current collection of asset codecs
    • createRepositoryModel

      public ILcdModel createRepositoryModel(String aSourceName) throws IOException
      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 repository
      aTileSet - the tileset that will provide tiles to the repository
      aModelReference - 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 a TLcdEarthTileRepository instance.

      Parameters:
      aRepositoryName - the name of the repository to open
      aTileSet - 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: