Class TLcdAIXMModelDecoder

java.lang.Object
com.luciad.format.aixm.decoder.TLcdAIXMModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdAIXMModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This ILcdModelDecoder implementation represents an AIXM data source decoder.

This decoder allows configuration of the types of AIS objects to be decoded. For each type of object, a specific ILcdAIXMHandler implementation must be added to the decoder by invoking addHandlerForTypeToBeDecoded(ILcdAIXMHandler). If no handlers are added, all available handers are automatically added.

Input files

File Required Entry point Description
*.xml x x
XML file containing a AIXM data

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the ILcdInputStreamFactory of this decoder.

Model structure

  • Decoding an AIXM data file using this decoder will result in
    • either a single model, if there's only one handler specified,
    • or a TLcdModelList, that will contain a submodel for each handler added to the decoder. If necessary, this model list can be decomposed back into a set of individual models.
  • If no handlers are registered at all, an empty model will be returned by the decoder.

Model descriptor

  • All models returned by this model decoder have a TLcdAIXMModelListDescriptor.
  • The type name of the model descriptor is the display name of this decoder.

Model reference

Model elements

Sample code


 ILcdModelDecoder decoder = new TLcdAIXMModelDecoder();
 ILcdModel model = decoder.decode( "aixm_data.xml" );
 

Performance tips

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.

Supported versions

  • The supported AIXM specifications for this decoder are version 3.3, 4.0 and 4.5. For more information about the specifications, see the EUROCONTROL website.
  • AIXM version 5.1 is supported by another decoder implementation, TLcdAIXM51ModelDecoder.

Limitations

  • The following domain objects in AIXM data are not decoded:
    • Aerodrome/Heliport ground services (Ahs)
    • Aeronautical ground lights (Agl)
    • Address information (Aha, Oaa)
    • Aerodrome/Heliport collocations (Ahc)
    • Angle indications (Ain)
    • Aerodrome/navaid relationships (Ana)
    • APRON (Apg, Apn)
    • Distance indications (Din)
    • MLS (Microwave landing systems)
    • Navaid limitations (Dln, Vln, ...)
    • Navigation System Checkpoints (Nsc)
    • FATO (Fao)
    • Frequency (Fqy)
    • Fuel information (Ful)
    • Gate stands (Gsd)
    • Holding procedures (Hpe)
    • Oil data (Oil)
    • Organisation information (Org)
    • Passenger facilities (Pfy)
    • Timesheets (Agt, Ast, Att, Ftt, ...)
    • TLOF (Tla)
  • The handler for procedures (SID, STAR, IAP), `TLcdAIXMProcedureHandler`, currently does not support AIXM-Update data.
  • Domain objects that don't have a geometry in an AIXM dataset will not appear in the decoded models. For example, AIXM allows to define a procedure without procedure legs, because the geometry is optional for this domain object. In that case, the procedure will not be decoded as it cannot be visualized on a map.
See Also:
  • Constructor Details

    • TLcdAIXMModelDecoder

      public TLcdAIXMModelDecoder()
      Constructs a new TLcdAIXMModelDecoder object with all of the default ILcdAIXMHandlers installed.

      You can decode one or more specific AIXM domain objects (e.g. navaids, routes, airspaces, ...), by registering one or more ILcdAIXMHandler objects through addHandlerForTypeToBeDecoded(ILcdAIXMHandler). In this case, the default handlers will not be used.

  • 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.
    • canUpdateFromSource

      public boolean canUpdateFromSource(String aSourceName)
      Checks whether the supplied file or data source is recognized as a decodable AIXM update format.
      Parameters:
      aSourceName - a data source; typically a file name or a URL.
      Returns:
      true if the source is recognized as a decodable AIXM update format.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Checks whether the supplied file or data source is recognized as a decodable AIXM format; this can be either an AIXM-Snapshot or AIXM-Update file.
      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - a data source; typically a file name or a URL.
      Returns:
      true if the source is recognized as a decodable AIXM format.
      See Also:
    • updateSFCT

      public void updateSFCT(String aSource, ILcdModel aModel) throws IOException
      Updates the supplied model with the given source containing AIXM update data.

      The model can either be a single model or a TLcdModelList. Each model for which a corresponding handler (ILcdAIXMHandler) has been registered will be updated if there is update data available. A handler is considered suitable for updating a model if it uses the same model descriptor.

      Parameters:
      aSource - the full path to the file containing AIXM update data, including the file name.
      aModel - a model containing AIXM data that must be updated.
      Throws:
      IOException - thrown if an error occurs during the read process.
    • decode

      public ILcdModel decode(String aSource) throws IOException
      Decodes the given source and returns an ILcdModel containing the decoded AIXM objects.

      By default, all available handlers are registered. Otherwise, before invoking this method, a handler (ILcdAIXMHandler) can be registered on this decoder for each type of object that must be decoded, through addHandlerForTypeToBeDecoded(ILcdAIXMHandler). For example, a TLcdAIXMAerodromeHandler can be registered to decode Aerodrome objects. In this case, the default handlers are ignored.

      For each handler registered on this decoder, a new model will be created. When multiple handlers are registered, a TLcdModelList is returned containing all the created models. If necessary, this model list can be decomposed back into a set of individual models

      If no handlers are registered at all, an empty model will be returned.

      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSource - the full path to the file to be decoded, including the file name.
      Returns:
      a model containing the decoded objects (possibly as a set of sub models).
      Throws:
      IOException - thrown if an error occurs during the read process.
      See Also:
    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is currently used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is currently used.
    • addHandlerForTypeToBeDecoded

      public void addHandlerForTypeToBeDecoded(ILcdAIXMHandler aHandler)
      Adds an ILcdAIXMHandler to the decoder.

      This is optional, if none is added, all the default handlers are used. Once you add one specific handler, the default handlers will never be used.

      Each handler will generate an ILcdModel containing one specific kind of domain object. At the end of the decode process, the models created by the available handlers will be brought together in a TLcdModelList.

      Parameters:
      aHandler - an ILcdAIXMHandler implementation
      See Also:
    • getHandlerForTypeToBeDecoded

      public ILcdAIXMHandler getHandlerForTypeToBeDecoded(int aIndex)
      Returns the handler with the given index.
      Parameters:
      aIndex - the index in the list of handlers
      Returns:
      the handler at the given index
      See Also:
    • getHandlerForTypeToBeDecodedCount

      public int getHandlerForTypeToBeDecodedCount()
      Returns the number of handlers set on this decoder.
      Returns:
      the number of handlers
      See Also:
    • removeAllHandlersForTypeToBeDecoded

      public void removeAllHandlersForTypeToBeDecoded()
      Removes all handlers from this decoder.
      See Also:
    • getErrorMessage

      public String getErrorMessage()
      Returns the error message of the last decode call (when an error occurred).

      Note: the error message can only be retrieved once after a decode call.

      Returns:
      a string containing the errors occurred during the last decode process
    • setInitialBounds

      public void setInitialBounds(ILcdBounds aInitialBounds)
      Specifies the bounds to be used as initial bounds for each model created in the decode method.

      This bounds should be large enough to enclose (most of) the model objects. This option can improve performance by avoiding too many expansions of the model bounds.

      This parameter may be null.

      Note: This bounds is not a filter! If a model objects bounds does not interact with aInitialBounds, aInitialBounds will be enlarged to enclose the object.

      Parameters:
      aInitialBounds - the initial bounds for each model created in the decode method
    • setBoundsToFilterOn

      public void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
      Specifies the bounds that will be used as a filter on each model created in the decode method. Note that all necessary ILcdAIXMHandler instances should be registered before calling this method. A bounds filter can also be set on separate ILcdAIXMHandler instances.

      If this bounds is null, all objects found in the input file will be inserted into the model. If this bounds is not null, only the objects whose bounds interact with the specified bounds will be inserted into the model.

      Parameters:
      aBoundsToFilterOn - the bounds to be used as a filter
    • getInitialBounds

      public ILcdBounds getInitialBounds()
      Returns the initial bounds for each model created in the decode method.
      Returns:
      the initial bounds for each model created in the decode method
      See Also:
    • getBoundsToFilterOn

      public ILcdBounds getBoundsToFilterOn()
      Returns the bounds to filter on.
      Returns:
      the bounds to be filtered on
      See Also:
    • isTraceOn

      public static boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setTraceOn

      public static void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.