public final class TLcdModelMetadata extends Object
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();
Modifier and Type | Class and Description |
---|---|
static class |
TLcdModelMetadata.Builder
Builder for creating a model metadata object.
|
static class |
TLcdModelMetadata.DataCategory
Determines the category of data.
|
static class |
TLcdModelMetadata.Source
A source name and its (optionally) associated mime type.
|
Modifier and Type | Method and Description |
---|---|
TLcdModelMetadata.Builder |
asBuilder()
Creates a new builder initialized with all the properties of this metadata object.
|
List<TLcdModelMetadata> |
discoverDataSeries()
Discovers metadata about the datasets that are aggregated by this dataset, if any.
|
List<TLcdModelMetadata.Source> |
discoverSupportingSources()
Attempts to discover supporting sources of the model.
|
ILcdBounds |
getBounds()
Returns the bounds of the model, or an undefined
ILcdBounds instance if the model is not bounded or its
bounds are unknown. |
Set<TLcdModelMetadata.DataCategory> |
getDataCategories()
Returns the kind of data the model contains
|
Optional<ILcdDataSource> |
getDataSource()
Returns the source of the model.
|
List<? extends ILcdDimension<?>> |
getDimensions()
Returns the dimensions of the model.
|
Optional<TLcdModelMetadata.Source> |
getEntryPoint()
Returns the entry point of the model.
|
String |
getFormat()
Returns the data format of the model.
|
Optional<ILcdModelReference> |
getModelReference()
Returns the model reference of the model.
|
ILcdResourceMetadata |
getResourceMetadata()
Returns generic metadata about the model.
|
String |
getTitle()
Returns the title or display name of the model.
|
static TLcdModelMetadata.Builder |
newBuilder()
Returns a builder for creating a new model metadata object.
|
String |
toString() |
public Optional<ILcdModelReference> getModelReference()
Optional.empty()
if the model is not georeferenced, or the model reference
is not knownpublic ILcdBounds getBounds()
ILcdBounds
instance if the model is not bounded or its
bounds are unknown.
public Optional<ILcdDataSource> getDataSource()
Optional.empty()
if the source is not knownpublic List<? extends ILcdDimension<?>> getDimensions()
ILcdMultiDimensional
.ILcdMultiDimensional.getDimensions()
public ILcdResourceMetadata getResourceMetadata()
asBuilder()
and adjust the values using this builder to make sure the model
metadata and its resource metadata remain consistent.
TLcdISO19115Metadata
.public Set<TLcdModelMetadata.DataCategory> getDataCategories()
public String getFormat()
ILcdModelDescriptor.getTypeName()
).public String getTitle()
()
public Optional<TLcdModelMetadata.Source> getEntryPoint()
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.
Optional.empty()
if no entry point is defined.public List<TLcdModelMetadata.Source> discoverSupportingSources() throws IOException
.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.
IOException
- If the discovery fails because of an IO problem, or because the data format does
not allow inspecting its supporting sources.public List<TLcdModelMetadata> discoverDataSeries() throws IOException
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.
IOException
- If the data series discovery fails.public static TLcdModelMetadata.Builder newBuilder()
public TLcdModelMetadata.Builder asBuilder()