Package com.luciad.format.pegasus
Class TLcdPegasusModelDecoder
java.lang.Object
com.luciad.format.pegasus.TLcdPegasusModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable,ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=19999)
public class TLcdPegasusModelDecoder
extends Object
implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes panoramic images from Pegasus datasets.
Input
The model decoder supports these naming schemas:-
External Orientation.csvnaming schemaFile Required Entry point Description External Orientation.csv x x This file contains the information about the panoramic images. Internal Orientation.txt x This file contains camera-specific information that counts for all images. <image files> x The External orientation.csvfile refers to image files. -
*_Sphere.csvnaming schemaFile Required Entry point Description *_Sphere.csv x x This file contains the information about the panoramic images. *_Sphere.txt x This file contains camera-specific information that counts for all images. The file name part before the .txtextension must exactly match the.csvfile name.<image files> x The <job-name>_<track-name>_Sphere.csvfile refers to image files.
Supported transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
ILcdInputStreamFactoryof this decoder.
Model structure
- This model decoder creates a model per
External orientation.csvfile. - All models returned by this model decoder implement
ILcd2DBoundsIndexedModel.
Model descriptor
- All models returned by this model decoder have a
ILcdPanoramaModelDescriptor. - The type name of the model descriptor is the display name of this decoder: "Pegasus"
- The display name of the model descriptor will be in the form "<project>/<track>", and is derived from the
source name, depending on the naming schema:
-
External Orientation.csvnaming schema: the decoder will try to derive the name from the directory structure: path/to/<project>/<track>/External Orientation.csv. -
_Sphere.csvnaming schema: the decoder will derive the name from the filename of the entry point: <project>_<track>_Sphere.csv.
-
Model reference
The Pegasus model is not georeferenced, meaning that an external georeference is needed to properly decode this type of file within geospatial context.- If set, the model reference decoder is used.
- If the model reference decoder does not find a reference, the default model reference is used.
Model elements
- Each decoded model contains elements that implement
ILcdPanorama.
Sample code
ILcdModelDecoder decoder = new TLcdPegasusModelDecoder();
ILcdModel model = decoder.decode("External orientation.csv");
Note that visualizing the panoramic images in LuciadLightspeed is not supported.
The models that are decoded with this decoder are intended to be converted to the Luciad Panorama Format, that can be served
with LuciadFusion for visualisation with LuciadRIA.
See the Panoramic images guide for more information.
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models are thread-safe for read access.
- Since:
- 2020.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns the default model reference that is assigned to decoded models whose files don't specify model references.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used.Returns the model reference decoder that will be used while decoding.voidsetDefaultModelReference(ILcdModelReference aDefaultModelReference) Sets the default model reference to be assigned to decoded models whose files don't specify model references.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.voidsetModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder) Sets the model reference decoder that will be used for files that don't specify model references.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
TYPE_NAME
- See Also:
-
-
Constructor Details
-
TLcdPegasusModelDecoder
public TLcdPegasusModelDecoder()
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows an exception for that same source name.For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
- Specified by:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
setModelReferenceDecoder
Sets the model reference decoder that will be used for files that don't specify model references.- Parameters:
aModelReferenceDecoder- the model reference decoder.
-
getModelReferenceDecoder
Returns the model reference decoder that will be used while decoding. The default reference decoder set on this model decoder is based on all model reference decoders annotated with theLcdServiceannotation, and can handle- EPSG references (
<filename>.epsg): seeTLcdEPSGModelReferenceDecoderfor more info. - WKT references (
<filename>.prj): seeTLcdWKTModelReferenceDecoderfor more info. - Luciad encoded model references (
<filename>.ref): seeTLcdModelReferenceDecoderfor more info.
- Returns:
- the model reference decoder used by this decoder
- See Also:
- EPSG references (
-
setDefaultModelReference
Sets the default model reference to be assigned to decoded models whose files don't specify model references.- Parameters:
aDefaultModelReference- the default model reference.
-
getDefaultModelReference
Returns the default model reference that is assigned to decoded models whose files don't specify model references. -
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.
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- 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); } }- See Also:
-