Interface ILcdMetadataDecoder
- All Known Implementing Classes:
TLcdCompositeMetadataDecoder
,TLcdECWModelDecoder
,TLcdGDALModelDecoder
,TLcdISO19139MetadataDecoder
,TLcdS57CatalogueModelDecoder
,TLcdS57ModelDecoder
,TLcdS57UnifiedModelDecoder
,TLcdS63CatalogueModelDecoder
,TLcdS63ModelDecoder
,TLcdS63UnifiedModelDecoder
TLcdISO19115Metadata
from a source name.
The source name can be that of a dedicated metadata file, or it can be the source name of a data set.
Some data formats do not include the metadata in their data files. For these formats, additional metadata file(s) may
be placed next to the data file. The method findAndDecodeMetadata(String)
can be used to discover these
metadata file(s).
The TLcdISO19139MetadataDecoder
is an implementation of this interface which
allows decoding ISO-19115 metadata from an ISO-19139 XML source.
- Since:
- 2014.0
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
ATLcdISO19115Metadata
paired with the metadata source file(s) from which the metadata was decoded. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeMetadata
(String aSourceName) Tells whether this metadata decoder can likely decode metadata for a given source name.decodeMetadata
(String aSourceName) Decodes the metadata from a given source name as an ISO-19115 metadata object.findAndDecodeMetadata
(String aSourceName) Searches metadata files for a given source name and decodes them as an ISO-19115 metadata object.
-
Method Details
-
canDecodeMetadata
Tells whether this metadata decoder can likely decode metadata for a given source name.-
If
true
, it is likely thatdecodeMetadata(String)
will return a non-nullTLcdISO19115Metadata
object, but it is not a guarantee. The result is optimistic. -
If
false
, it is guaranteed thatdecodeMetadata(String)
will throw an exception or returnnull
.
- Parameters:
aSourceName
- the source name to decode metadata for- Returns:
true
if this metadata decoder can decode metadata for the given source name,false
otherwise
-
If
-
decodeMetadata
Decodes the metadata from a given source name as an ISO-19115 metadata object.Note that even if
canDecodeMetadata(String)
returnstrue
, this method may yet not be able to decode the given source name. While returningnull
is allowed when this decoder couldn't decode the given source name, implementors are advised to throw an error instead.- Parameters:
aSourceName
- the source name to decode metadata from- Returns:
- a metadata object
- Throws:
IOException
- if the metadata cannot be decoded for some reason
-
findAndDecodeMetadata
default ILcdMetadataDecoder.MetadataWithSource findAndDecodeMetadata(String aSourceName) throws IOException Searches metadata files for a given source name and decodes them as an ISO-19115 metadata object. The given source name points to a data set, not to a dedicated metadata file. A return value ofnull
indicates that this decoder could not find dedicated metadata files for the given source name.This method returns a
ILcdMetadataDecoder.MetadataWithSource
, which combines the decoded metadata together with the names of the dedicated metadata files which were used for decoding theTLcdISO19115Metadata
object. If notnull
, the decoded metadata should be the result of calling thedecodeMetadata(String)
method, passing one of these dedicated metadata files.The default implementation returns null.
- Parameters:
aSourceName
- a data source for which to find and decode the metadata- Returns:
- the decoded
TLcdISO19115Metadata
and the location of the metadata file(s) from which the metadata was decoded, ornull
if no metadata files could be found. - Throws:
IOException
- if the found metadata cannot be decoded for some reason- Since:
- 2022.1
-