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
Constructors -
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.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.
-
Constructor Details
-
TLcdRPCModelReferenceDecoder
public TLcdRPCModelReferenceDecoder()
-
-
Method Details
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin 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:
decodeModelReferencein interfaceILcdModelReferenceDecoder- Parameters:
aDataSourceName- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the
ILcdModelReferenceassociated with the data source. Whilenullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- if theILcdModelReferencecannot 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:ILcdModelReferenceDecoderFinds 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 anullsource, indicating that the source is unknown or does not exist.- Specified by:
findAndDecodeModelReferencein interfaceILcdModelReferenceDecoder- Parameters:
aDataSourceName- a data source for which to return the model reference; typically a file name or a URL.- Returns:
- the decoded
ILcdModelReferenceand the location of the reference file. Nevernull. - Throws:
IOException- if no model reference file is found, or theILcdModelReferencecannot 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.
-