@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdGEEModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
File | Required | Entry point | Description |
---|---|---|---|
*.kiasset | X | X | A directory containing the Google Earth Enterprise image repository |
ILcd2DBoundsIndexedModel
.ALcdImage
can be obtained from the domain object using ALcdImage.fromDomainObject(java.lang.Object)
. ALcdImage
element.ALcdMultilevelImageMosaic
ILcdImageModelDescriptor
.ILcdGeodeticReference
or ILcdGridReference
.
// decode the model TLcdGEEModelDecoder decoder = new TLcdGEEModelDecoder(); ILcdModel model = decoder.decode(aSource); // retrieve the image data Object domainObject = model.elements().nextElement(); ALcdImage image = ALcdImage.fromDomainObject(domainObject);
Constructor and Description |
---|
TLcdGEEModelDecoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSource)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String TYPE_NAME
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSource)
canDecodeSource
in interface ILcdModelDecoder
aSource
- the directory containing the repositorytrue
if the given source name matches a directory that this decoder can decode, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
decode
in interface ILcdModelDecoder
aSourceName
- the directory containing the repositoryIOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost
always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException,
IllegalArgumentException, ...) on unexpected places, implementations are advised to catch
RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated
in the code snippet below.
public ILcdModel decode( String aSourceName ) throws IOException {
try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
// Perform decoding ...
} catch (RuntimeException e) {
throw new IOException(e);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable