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.csv
naming 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.csv
file refers to image files. -
*_Sphere.csv
naming 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 .txt
extension must exactly match the.csv
file name.<image files> x The <job-name>_<track-name>_Sphere.csv
file refers to image files.
Supported transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
ILcdInputStreamFactory
of this decoder.
Model structure
- This model decoder creates a model per
External orientation.csv
file. - 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.csv
naming schema: the decoder will try to derive the name from the directory structure: path/to/<project>/<track>/External Orientation.csv. -
_Sphere.csv
naming 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(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.void
setDefaultModelReference
(ILcdModelReference aDefaultModelReference) Sets the default model reference to be assigned to decoded models whose files don't specify model references.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.void
setModelReferenceDecoder
(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, wait
Methods 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:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
throws 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:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be verified; typically a file name or a URL.- Returns:
true
if this decoder can likely decode the data specified by the source name,false
otherwise.- 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 theLcdService
annotation, and can handle- EPSG references (
<filename>.epsg
): seeTLcdEPSGModelReferenceDecoder
for more info. - WKT references (
<filename>.prj
): seeTLcdWKTModelReferenceDecoder
for more info. - Luciad encoded model references (
<filename>.ref
): seeTLcdModelReferenceDecoder
for 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: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.
-
decode
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is 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:
-