@LcdService(service=ILcdModelReferenceDecoder.class, priority=20000) public class TLcdRPCModelReferenceDecoder extends Object implements ILcdModelReferenceDecoder, ILcdInputStreamFactoryCapable
_rpc.txt
extension.
The decoder first tries to find the _rpc.txt
file by replacing the extension of the
source file, or by appending _rpc.txt
if there was no
suffix. If this fails, the decoder attempts to open the original input file name.
The format is a plain text format containing lines with one parameter/value pair per line. The parameters may be given in any order. The format of a line is
PARAMETER: value [unit-of-measure]For example:
LINE_OFF: +000837.00 pixels SAMP_OFF: +002522.00 pixels LAT_OFF: +32.72160000 degrees LAT_SCALE: +00.01580000 degrees LINE_NUM_COEFF_1: -1.588273187168747E-03 ...
TLcdGeoTIFFModelDecoder decoder =
new TLcdGeoTIFFModelDecoder( new TLcdRPCModelReferenceDecoder() );
ILcdModel model = decoder.decode( "image.tif" );
TLcdCompositeModelReferenceDecoder
ILcdModelReferenceDecoder.ModelReferenceWithSource
Constructor and Description |
---|
TLcdRPCModelReferenceDecoder() |
Modifier and Type | Method and Description |
---|---|
ILcdModelReference |
decodeModelReference(String aDataSourceName)
Returns the model reference, associated with the specified data source.
|
ILcdModelReferenceDecoder.ModelReferenceWithSource |
findAndDecodeModelReference(String aDataSourceName)
Finds and decodes the model reference file, associated with the specified data source.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public ILcdModelReference decodeModelReference(String aDataSourceName) throws IOException
findAndDecodeModelReference(java.lang.String)
and returns the resulting model reference.decodeModelReference
in interface ILcdModelReferenceDecoder
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.ILcdModelReference
associated with the data source. While null
is allowed,
implementors are advised to throw an error instead.IOException
- if the ILcdModelReference
cannot be decoded.
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.public ILcdModelReferenceDecoder.ModelReferenceWithSource findAndDecodeModelReference(String aDataSourceName) throws IOException
ILcdModelReferenceDecoder
ILcdModelReferenceDecoder.decodeModelReference(java.lang.String)
and returns the resulting model reference, paired with a null
source, indicating that the source is unknown or does not exist.findAndDecodeModelReference
in interface ILcdModelReferenceDecoder
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.ILcdModelReference
and the location of the reference file. Never null
.IOException
- if no model reference file is found, or the ILcdModelReference
cannot be
decoded.
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.