Package com.luciad.reference
Class TLcdRPCModelReferenceDecoder
java.lang.Object
com.luciad.reference.TLcdRPCModelReferenceDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelReferenceDecoder
@LcdService(service=ILcdModelReferenceDecoder.class,
priority=20000)
public class TLcdRPCModelReferenceDecoder
extends Object
implements ILcdModelReferenceDecoder, ILcdInputStreamFactoryCapable
This model reference decoder constructs model references based on the rational
polynomial coefficients read from RPC files, as distributed by GeoEye. Such
files typically accompany GeoTIFF files and have an
_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 ...
Sample Code
For instance, creating a GeoTIFF model decoder that retrieves its references from an accompanying RPC text file:
TLcdGeoTIFFModelDecoder decoder =
new TLcdGeoTIFFModelDecoder( new TLcdRPCModelReferenceDecoder() );
ILcdModel model = decoder.decode( "image.tif" );
- Since:
- 9.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.model.ILcdModelReferenceDecoder
ILcdModelReferenceDecoder.ModelReferenceWithSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeModelReference
(String aDataSourceName) Returns the model reference, associated with the specified data source.findAndDecodeModelReference
(String aDataSourceName) Finds and decodes the model reference file, associated with the specified data source.Returns the input stream factory that is used.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.
-
Constructor Details
-
TLcdRPCModelReferenceDecoder
public TLcdRPCModelReferenceDecoder()
-
-
Method Details
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapable
Sets the input stream factory to be used.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapable
Returns the input stream factory that is used.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is used.
-
decodeModelReference
Returns the model reference, associated with the specified data source. This implementation delegates tofindAndDecodeModelReference(java.lang.String)
and returns the resulting model reference.- Specified by:
decodeModelReference
in interfaceILcdModelReferenceDecoder
- Parameters:
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the
ILcdModelReference
associated with the data source. Whilenull
is allowed, implementors are advised to throw an error instead. - Throws:
IOException
- if theILcdModelReference
cannot be decoded.
When the thread on which this method is called is interrupted, it is recommended to stop the decoding and throw anInterruptedIOException
. This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding through the UI.
-
findAndDecodeModelReference
public ILcdModelReferenceDecoder.ModelReferenceWithSource findAndDecodeModelReference(String aDataSourceName) throws IOException Description copied from interface:ILcdModelReferenceDecoder
Finds and decodes the model reference file, associated with the specified data source. The default implementation delegates toILcdModelReferenceDecoder.decodeModelReference(java.lang.String)
and returns the resulting model reference, paired with anull
source, indicating that the source is unknown or does not exist.- Specified by:
findAndDecodeModelReference
in interfaceILcdModelReferenceDecoder
- Parameters:
aDataSourceName
- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the decoded
ILcdModelReference
and the location of the reference file. Nevernull
. - Throws:
IOException
- if no model reference file is found, or theILcdModelReference
cannot be decoded.
When the thread on which this method is called is interrupted, it is recommended to stop the decoding and throw anInterruptedIOException
. This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding through the UI.
-