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 schema
    File 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 schema
    File 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 &lt;job-name>_&lt;track-name>_Sphere.csv file refers to image files.
For both naming schemas, all input files must be in the same directory.

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.

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 Details

  • Constructor Details

    • TLcdPegasusModelDecoder

      public TLcdPegasusModelDecoder()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode 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 interface ILcdModelDecoder
      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

      public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
      Sets the model reference decoder that will be used for files that don't specify model references.
      Parameters:
      aModelReferenceDecoder - the model reference decoder.
    • getModelReferenceDecoder

      public ILcdModelReferenceDecoder 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 the LcdService annotation, and can handle
      Returns:
      the model reference decoder used by this decoder
      See Also:
    • setDefaultModelReference

      public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
      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

      public ILcdModelReference getDefaultModelReference()
      Returns the default model reference that is assigned to decoded models whose files don't specify model references.
    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Description copied from interface: ILcdInputStreamFactoryCapable
      Sets the input stream factory to be used.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Description copied from interface: ILcdInputStreamFactoryCapable
      Returns the input stream factory that is used.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      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: