Package com.luciad.format.aixm.decoder
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
- All models returned by this model decoder have a
TLcdGeodeticReference
. - The used datum is a standard
TLcdGeodeticDatum
(WGS-84).
Model elements
- All AIXM model elements use an
AIXM data type
. For more information about the model and its elements, see thecom.luciad.format.aixm.model
package and its sub-packages.
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 Summary
ConstructorDescriptionConstructs a newTLcdAIXMModelDecoder
object with all of the defaultILcdAIXMHandler
s installed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHandlerForTypeToBeDecoded
(ILcdAIXMHandler aHandler) Adds anILcdAIXMHandler
to the decoder.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.boolean
canUpdateFromSource
(String aSourceName) Checks whether the supplied file or data source is recognized as a decodable AIXM update format.Decodes the given source and returns anILcdModel
containing the decoded AIXM objects.Returns the bounds to filter on.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Returns the error message of the last decode call (when an error occurred).getHandlerForTypeToBeDecoded
(int aIndex) Returns the handler with the given index.int
Returns the number of handlers set on this decoder.Returns the initial bounds for each model created in thedecode
method.Returns the input stream factory that is currently used for creating input streams given source names.static boolean
Deprecated.This method has been deprecated.void
Removes all handlers from this decoder.void
setBoundsToFilterOn
(ILcdBounds aBoundsToFilterOn) Specifies the bounds that will be used as a filter on each model created in thedecode
method.void
setInitialBounds
(ILcdBounds aInitialBounds) Specifies the bounds to be used as initial bounds for each model created in thedecode
method.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.static void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
updateSFCT
(String aSource, ILcdModel aModel) Updates the supplied model with the given source containing AIXM update data.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
-
Constructor Details
-
TLcdAIXMModelDecoder
public TLcdAIXMModelDecoder()Constructs a newTLcdAIXMModelDecoder
object with all of the defaultILcdAIXMHandler
s installed. You can decode one or more specific AIXM domain objects (e.g. navaids, routes, airspaces, ...), by registering one or moreILcdAIXMHandler
objects throughaddHandlerForTypeToBeDecoded(ILcdAIXMHandler)
. In this case, the default handlers will not be used.
-
-
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
.
-
canUpdateFromSource
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
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 interfaceILcdModelDecoder
- 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
Updates the supplied model with the given source containing AIXM update data. The model can either be a single model or aTLcdModelList
. 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
Decodes the given source and returns anILcdModel
containing the decoded AIXM objects. By default, all availablehandlers
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, throughaddHandlerForTypeToBeDecoded(ILcdAIXMHandler)
. For example, aTLcdAIXMAerodromeHandler
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, aTLcdModelList
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 interfaceILcdModelDecoder
- 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
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is currently used for creating input streams given source names.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is currently used.
-
addHandlerForTypeToBeDecoded
Adds anILcdAIXMHandler
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 anILcdModel
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 aTLcdModelList
.- Parameters:
aHandler
- anILcdAIXMHandler
implementation- See Also:
-
getHandlerForTypeToBeDecoded
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
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
Specifies the bounds to be used as initial bounds for each model created in thedecode
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 thedecode
method
-
setBoundsToFilterOn
Specifies the bounds that will be used as a filter on each model created in thedecode
method. Note that all necessaryILcdAIXMHandler
instances should be registered before calling this method. A bounds filter can also be set on separateILcdAIXMHandler
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
Returns the initial bounds for each model created in thedecode
method.- Returns:
- the initial bounds for each model created
in the
decode
method - See Also:
-
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.Returnstrue
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 istrue
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.
-