Class TLcdModelMetadata

java.lang.Object
com.luciad.model.TLcdModelMetadata

public final class TLcdModelMetadata extends Object
Encapsulates advanced metadata information (including ISO 19115 metadata) about ILcdModel instances. This information can be retrieved through a model decoder or from any model.

Model metadata is created using a builder. It cannot be modified directly, but you can recreate it and customize it as shown here:


   // create a new metadata instance with a different title
   newMetadata = oldMetadata.asBuilder().title(newTitle).build();
 
Since:
2018.0
  • Method Details

    • getModelReference

      public Optional<ILcdModelReference> getModelReference()
      Returns the model reference of the model.
      Returns:
      the model reference, or Optional.empty() if the model is not georeferenced, or the model reference is not known
    • getBounds

      public ILcdBounds getBounds()
      Returns the bounds of the model, or an undefined ILcdBounds instance if the model is not bounded or its bounds are unknown.
      Warning: depending on whether the whole model needs to be decoded, this method might perform expensive I/O calls and therefore take a long time to execute when it is first called.
      Returns:
      the model bounds, expressed in the model reference. The bounds can be undefined, but never null.
    • getDataSource

      public Optional<ILcdDataSource> getDataSource()
      Returns the source of the model. This is the main property for denoting the source of the model: if the model has an external source, this property is always present.
      Returns:
      the source of the model, or Optional.empty() if the source is not known
    • getDimensions

      public List<? extends ILcdDimension<?>> getDimensions()
      Returns the dimensions of the model. Can be empty if the referenced model does not implement ILcdMultiDimensional.
      Returns:
      the dimensions of the model. Can be empty, but never null.
      See Also:
    • getResourceMetadata

      public ILcdResourceMetadata getResourceMetadata()
      Returns generic metadata about the model. Note that altering values in the resource metadata directly will not necessarily update this model metadata. Instead, use asBuilder() and adjust the values using this builder to make sure the model metadata and its resource metadata remain consistent.
      Warning: depending on whether the whole model needs to be decoded, this method might perform expensive I/O calls and therefore take a long time to execute when it is first called.
      Returns:
      metadata about the model, never null. This will also be an instance of TLcdISO19115Metadata.
    • getDataCategories

      public Set<TLcdModelMetadata.DataCategory> getDataCategories()
      Returns the kind of data the model contains
      Returns:
      a set of data categories for all different kinds of data that this model contains
    • getUnitsOfMeasure

      public Set<ILcdISO19103UnitOfMeasure> getUnitsOfMeasure()
      Returns the units of measure of the data the model contains. Typical units of measure include terrain height, or weather related information such as temperature.
      Returns:
      a set of the units of measure of the data this model contains

      See ALcdBandMeasurementSemantics.getUnitOfMeasure() for how to retrieve the unit of measure from models containing images.

      Since:
      2023.1
    • getFormat

      public String getFormat()
      Returns the data format of the model. This method returns a human-readable name for the data format and is primarily meant for display purposes. It can be used as an easy means to identify a format as well, but it is not guaranteed to be unique, so additional checks may be necessary (for example, with ILcdModelDescriptor.getTypeName()).
      Returns:
      the data format, or null if the format is not known
    • getTitle

      public String getTitle()
      Returns the title or display name of the model.
      Returns:
      the title, or null if the title is not known
      See Also:
    • getEntryPoint

      public Optional<TLcdModelMetadata.Source> getEntryPoint()
      Returns the entry point of the model. This represents the source of the model, usually as a file, which can be decoded by its corresponding model decoder.

      Note that the main property for representing the model's source is getDataSource(). If the model has an external source, that property is always present, while the entry point will only be present if the source can be represented as an TLcdModelMetadata.Source instance.

      Returns:
      The entry point of the model, or Optional.empty() if no entry point is defined.
    • discoverSupportingSources

      public List<TLcdModelMetadata.Source> discoverSupportingSources() throws IOException
      Attempts to discover supporting sources of the model. These are sources that do not represent a model on their own, but rather provide supporting information about a model (for example, a .prj file next to the entry point, which defines the coordinate reference system of the model).

      Warning: depending on the implementation of the model decoder, this method might perform expensive I/O calls and therefore take a long time to execute. This is especially true for large data sets served over a network, for which big file downloads could be triggered. After this method has been called once, the result is cached and always returned immediately on every subsequent call. Even if the result was an exception, this exception will be cached and always rethrown.

      This method is thread safe. If it is called multiple times concurrently while no result has been cached yet, only one thread will perform the data series discovery and in the end, all calls return the same result.

      Returns:
      The supporting sources of the model, can be empty but never null.
      Throws:
      IOException - If the discovery fails because of an IO problem, or because the data format does not allow inspecting its supporting sources.
    • discoverDataSeries

      public List<TLcdModelMetadata> discoverDataSeries() throws IOException
      Discovers metadata about the datasets that are aggregated by this dataset, if any.

      Elements of this data series are individually decodable. They can have their own supporting sources or even comprise another data series themselves. For this reason, they are all represented by a separate TLcdModelMetadata instance. For example, a DMED dataset aggregates several DTED tiles and those tiles can be decoded individually as well, each of them having their own data source, title, bounding box et cetera.

      Warning: depending on the implementation of the model decoder, this method might perform expensive I/O calls and therefore take a long time to execute. This is especially true for large data sets served over a network, for which big file downloads could be triggered. After this method has been called once, the result is cached and always returned immediately on every subsequent call. Even if the result was an exception, this exception will be cached and always rethrown.

      This method is thread safe. If it is called multiple times concurrently while no result has been cached yet, only one thread will perform the data series discovery and in the end, all calls return the same result.

      Returns:
      If the model comprises a data series, returns a list of all child model's metadata. Otherwise, returns an empty list. Never returns null.
      Throws:
      IOException - If the data series discovery fails.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newBuilder

      public static TLcdModelMetadata.Builder newBuilder()
      Returns a builder for creating a new model metadata object.
      Returns:
      a new model metadata builder
    • asBuilder

      public TLcdModelMetadata.Builder asBuilder()
      Creates a new builder initialized with all the properties of this metadata object.
      Returns:
      the new builder.