Class TLcdDAFIFSpecialUseAirspaceDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder
,ILcdDAFIFSubTypeFilteringDecoder
,ILcdInputStreamFactoryCapable
,ILcdModelDecoder
ALcdDAFIFAirspaceDecoder
decodes special use
airspaces from a DAFIF source file. Decoded models have as model descriptor
an instance of TLcdDAFIFSpecialUseAirspaceModelDescriptor
. If subtype filtering
is enabled (via setSubTypesToDecode(int[])
), the decoder will produce a
TLcdModelList
with a TLcdDAFIFSpecialUseAirspaceModelListDescriptor
.
Each element of this model list will contain objects of one of the selected subtypes.
The number of models in the list, in other words, will equal the number of chosen
subtypes.
The objects in decoded models are based on the AIS domain objects available in com.luciad.ais.model
,
which all implement ILcdDataObject
. This interface provides a generic and
format-independent way of accessing the type and properties (features) of a domain object.
For this decoder, the type of the decoded objects is TLcdDAFIFDataTypes.SpecialUseAirspace
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFSpecialUseAirspaceDataProperties
.
The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty)
.
Next to ILcdDataObject
, the objects in decoded models also implement ILcdFeatured
,
the former interface to access the properties (features) of a domain object.
This is still fully supported, and explained in the following comments.
The setAirspaceFeaturesToBeDecoded
method allows
the user to specify which DAFIF features are decoded into the featured model objects.
If no features to be decoded are specified, all features will be decoded.
The following fields (taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Seventh Edition, May 2001) are supported by the decoder. The list indicates into which feature the fields are decoded.
- BOUNDARY IDENTIFICATION: ILcdDAFIFAirspaceFeature.BOUNDARY_IDENTIFICATION
- TYPE: ILcdAirspaceFeature.TYPE
- CLASS: ILcdDAFIFAirspaceFeature.CLASS
- NAME: ILcdAirspaceFeature.NAME
- ICAO CODE: ILcdDAFIFAirspaceFeature.ICAO_CODE, ILcdDAFIFAirspaceFeature.ICAO_REGION
- CONTROLLING AUTHORITY: ILcdDAFIFAirspaceFeature.CONTROLLING_AGENCY
- COMMUNICATIONS NAME: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_NAME
- COMMUNICATIONS FREQUENCY 1: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY1
- COMMUNICATIONS FREQUENCY 2: ILcdDAFIFAirspaceFeature.COMMUNICATIONS_FREQUENCY2
- LEVEL: ILcdDAFIFAirspaceFeature.LEVEL
- UPPER EFFECTIVE ALTITUDE: ILcdAirspaceFeature.UPPER_LIMIT, ILcdAirspaceFeature.UPPER_LIMIT_UNIT, ILcdAirspaceFeature.UPPER_LIMIT_REFERENCE
- LOWER EFFECTIVE ALTITUDE: ILcdAirspaceFeature.LOWER_LIMIT, ILcdAirspaceFeature.LOWER_LIMIT_UNIT, ILcdAirspaceFeature.LOWER_LIMIT_REFERENCE
- EFFECTIVE TIMES: ILcdDAFIFAirspaceFeature.EFFECTIVE_TIMES
- EFFECTIVE DATE: ILcdDAFIFAirspaceFeature.EFFECTIVE_DATE
DAFIF decoders rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For special use airspaces the key features are:
- See Also:
-
Field Summary
Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFAirspaceDecoder
fAirspaceFeaturesToBeDecoded, FORMAT_1, FORMAT_2, FORMAT_3, FORMAT_4, FORMAT_5, FORMAT_6
Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount
-
Constructor Summary
ConstructorDescriptionDeprecated.TLcdDAFIFSpecialUseAirspaceDecoder
(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object.TLcdDAFIFSpecialUseAirspaceDecoder
(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdEditableAirspace
createAirspace
(char[] aRecord) Creates and initializes an instance of an implementation of theILcdEditableAirspace
interface.protected ILcdModelDescriptor
createModelDescriptor
(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecode
method.Calls the decode method ofALcdDAFIFSingleModelDecoder
class.Object[]
Get an array of enumerated values defining all subtypes of a given DAFIF feature type.Returns the name of the file to be decoded.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.int[]
Returns the set of special use airspace types to be decoded.protected void
handleRecordFmt2
(char[] aRecord) Deals with the information found in a record of format 02.protected String
readAirspaceUID
(char[] aRecord) Reads the unique identifier of an airspace.protected float
readBearing1FromFmt4
(char[] aRecord) Reads bearing 1 of an arc or circle segment from a record of format 04.protected float
readBearing2FromFmt4
(char[] aRecord) Reads bearing 2 of an arc or circle segment from a record of format 04.protected double
readGeodeticLat0FromFmt4
(char[] aRecord) Reads a segments geodetic latitude from a record of format 04.protected double
readGeodeticLat1FromFmt3
(char[] aRecord) Reads a segments geodetic latitude 1 from a aRecord of format 03.protected double
readGeodeticLon0FromFmt4
(char[] aRecord) Reads a segments geodetic longitude 0 from a record of format 04.protected double
readGeodeticLon1FromFmt3
(char[] aRecord) Reads a segments geodetic longitude 1 from a aRecord of format 03.protected double
readLat0FromFmt3
(char[] aRecord) Reads a segments latitude 0 from a record of format 03.protected double
readLat1FromFmt3
(char[] aRecord) Reads a segments latitude 1 from a record of format 03.protected double
readLon0FromFmt3
(char[] aRecord) Reads a segments longitude 0 from a record of format 03.protected double
readLon1FromFmt3
(char[] aRecord) Reads a segments longitude 1 from a record of format 03.protected String
readNavaidUIDFromFmt4
(char[] aRecord) Reads the unique identifier of a navaid.protected float
readRadius1FromFmt4
(char[] aRecord) Reads the radius of an arc or circle segment from a record of format 04.protected float
readRadius2FromFmt4
(char[] aRecord) Reads radius 2 of an arc or circle segment from a record of format 04.protected int
readSegmentNumber
(char[] record) Reads the segment number.protected char
readShapeFromFmt3
(char[] aRecord) Reads a segments shape from a record of format 03.void
setAirspaceDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be the special use airspaces display name.void
setAirspaceFeaturesToBeDecoded
(String[] aFeaturesToBeDecoded) Specifies the features that should be decoded into the special use airspace objects of the model that will be returned by thedecode
method.void
setDAFIFModelFilter
(ILcdDAFIFModelFilter aFilter) Specifies a filter to be used while creating the model.void
setSubTypesToDecode
(int[] aTypes) Set the set of special use airspace types to be decoded.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFAirspaceDecoder
getAirspaceFeaturesToBeDecoded, handleRecord, retrieveAltitudeReference, retrieveAltitudeUnit, retrieveAltitudeValue, setAirspaceTypeToFilter
Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNames
Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
addErrorReport, canDecodeSource, getAltitudeType, getBearingTypeForChar, getBounds, getDAFIFProperties, getDataObjectFactory, getDecodingBounds, getDomainFactory, getErrorMessage, getInputStream, getInputStreamFactory, getLocalHorizontalDatum, getModelFilter, getRecordCount, initializeErrorMessage, isStoreOriginalReference, isTraceOn, loadCFGProperties, read, readExactValue, readFormat, readMinLength, readRecord, setBounds, setDAFIFProperties, setDataObjectFactory, setDecodingBounds, setDomainFactory, setInputStreamFactory, setStoreOriginalReference, setTraceOn, transformPointToReferenceDatumSFCT
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
-
TLcdDAFIFSpecialUseAirspaceDecoder
Deprecated.Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object. The user should specify which domainFactory he or she wants to use to create the special use airspaces.- Parameters:
aFactory
- the factory to be used to create the model objects
-
TLcdDAFIFSpecialUseAirspaceDecoder
Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object. The user should specify which factory he or she wants to use to create the special use airspaces.- Parameters:
aFactory
- the factory to be used to create the model objects
-
TLcdDAFIFSpecialUseAirspaceDecoder
@Deprecated public TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object. The user should specify which domainFactory he or she wants to use to create the special use airspaces.- Parameters:
aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
TLcdDAFIFSpecialUseAirspaceDecoder
public TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFSpecialUseAirspaceDecoder
object. The user should specify which factory he or she wants to use to create the special use airspaces.- Parameters:
aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
-
Method Details
-
decode
Description copied from class:ALcdDAFIFAirspaceDecoder
Calls the decode method ofALcdDAFIFSingleModelDecoder
class. Prints additional information about the number of segments to the log.- Specified by:
decode
in interfaceILcdModelDecoder
- Overrides:
decode
in classALcdDAFIFAirspaceDecoder
- Parameters:
aSourceName
- either the directory containing the Dafif source file to decode (if you did not specify a properties file in the constructor, the default file name will be used) or a .toc file containing the Dafif properties (the data file should be in the same directory as the .toc file)- Returns:
- the model build by reading the file found with aSource
- Throws:
IOException
- if an error occurs during the reading process- See Also:
-
setDAFIFModelFilter
Description copied from interface:ILcdDAFIFDecoder
Specifies a filter to be used while creating the model. Only model objects that pass through the filter will be in the resulting model.- Specified by:
setDAFIFModelFilter
in interfaceILcdDAFIFDecoder
- Overrides:
setDAFIFModelFilter
in classALcdDAFIFDecoder
- Parameters:
aFilter
- anILcdDAFIFModelFilter
to filter the model objects
-
getAvailableSubTypes
Get an array of enumerated values defining all subtypes of a given DAFIF feature type. Note : This array MUST NOT be modified. SeesetSubTypesToDecode(int[])
.- Specified by:
getAvailableSubTypes
in interfaceILcdDAFIFSubTypeFilteringDecoder
- Returns:
- an array of enumerated values defining subtypes of a given DAFIF feature type.
-
setSubTypesToDecode
public void setSubTypesToDecode(int[] aTypes) Set the set of special use airspace types to be decoded.- Specified by:
setSubTypesToDecode
in interfaceILcdDAFIFSubTypeFilteringDecoder
- Parameters:
aTypes
- an array of indices specifying which type of airspace will be decoded. Ifnull
is passed, reset to the default types.
-
getSubTypesToDecode
public int[] getSubTypesToDecode()Returns the set of special use airspace types to be decoded.- Specified by:
getSubTypesToDecode
in interfaceILcdDAFIFSubTypeFilteringDecoder
- Returns:
- the set of special use airspace types to be decoded.
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Overrides:
getDisplayName
in classALcdDAFIFDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
getDecodeFileName
Description copied from interface:ILcdDAFIFDecoder
Returns the name of the file to be decoded.Each domain object has its own file name. This method returns the name of the data file for the domain objects decoded by this DAFIF decoder.
- Specified by:
getDecodeFileName
in interfaceILcdDAFIFDecoder
- Returns:
- the name of the source file
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoder
Creates and returns the model descriptor to be set on the model returned in thedecode
method.- Specified by:
createModelDescriptor
in classALcdDAFIFSingleModelDecoder
- Parameters:
aSource
- the source that will be used to decode- Returns:
- a model descriptor describing the data in the model created in the decode method
-
setAirspaceFeaturesToBeDecoded
Specifies the features that should be decoded into the special use airspace objects of the model that will be returned by thedecode
method.Please make sure that the
BOUNDARY_IDENTIFICATION
feature, and theSECTOR
feature are in your list.If you want to filter on an airspace type, you should also include the
TYPE
feature into your list.- Overrides:
setAirspaceFeaturesToBeDecoded
in classALcdDAFIFAirspaceDecoder
- Parameters:
aFeaturesToBeDecoded
- a list of features that should be decoded into the special use airspace objects
-
createAirspace
Description copied from class:ALcdDAFIFAirspaceDecoder
Creates and initializes an instance of an implementation of theILcdEditableAirspace
interface.- Specified by:
createAirspace
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to retrieve information from
-
readAirspaceUID
Description copied from class:ALcdDAFIFAirspaceDecoder
Reads the unique identifier of an airspace.This unique identifier may consist of one or more features. The resulting
String
object is a concatenation of these feature values.- Specified by:
readAirspaceUID
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the unique identifier of an airspace
-
handleRecordFmt2
protected void handleRecordFmt2(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Deals with the information found in a record of format 02.- Specified by:
handleRecordFmt2
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- a record of format 02
-
readSegmentNumber
protected int readSegmentNumber(char[] record) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads the segment number.- Specified by:
readSegmentNumber
in classALcdDAFIFAirspaceDecoder
- Parameters:
record
- the record to read from- Returns:
- the segment sequence number
-
readShapeFromFmt3
protected char readShapeFromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments shape from a record of format 03.- Specified by:
readShapeFromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- a character that describes the shape of the segment (circle, arc, geodesic line, ...).
-
readLat1FromFmt3
protected double readLat1FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments latitude 1 from a record of format 03.Latitude 1 is the latitude of the begin point of the segment w.r.t a user specified geodetic datum.
Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.
- Specified by:
readLat1FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the latitude of the begin point of a segment
-
readLon1FromFmt3
protected double readLon1FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments longitude 1 from a record of format 03.Longitude 1 is the longitude of the begin point of the segment w.r.t a user specified geodetic datum.
Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.
- Specified by:
readLon1FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the longitude of the begin point of a segment
-
readLat0FromFmt3
protected double readLat0FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments latitude 0 from a record of format 03.The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.
- Specified by:
readLat0FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the latitude of the center point of an arc or circle segment
-
readLon0FromFmt3
protected double readLon0FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments longitude 0 from a record of format 03.The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.
- Specified by:
readLon0FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the longitude of the center point of an arc or circle segment
-
readGeodeticLat0FromFmt4
protected double readGeodeticLat0FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments geodetic latitude from a record of format 04.The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. WGS84.
- Specified by:
readGeodeticLat0FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the geodetic latitude of the center point of an arc or circle segment
- See Also:
-
readGeodeticLon0FromFmt4
protected double readGeodeticLon0FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments geodetic longitude 0 from a record of format 04.The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. WGS84.
- Specified by:
readGeodeticLon0FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the geodetic longitude of the center point of an arc or circle segment
- See Also:
-
readGeodeticLat1FromFmt3
protected double readGeodeticLat1FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments geodetic latitude 1 from a aRecord of format 03.Latitude 1 is the latitude of the begin point of the segment w.r.t WGS84.
Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.
- Specified by:
readGeodeticLat1FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the geodetic latitude of the begin point of a segment
- See Also:
-
readGeodeticLon1FromFmt3
protected double readGeodeticLon1FromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads a segments geodetic longitude 1 from a aRecord of format 03.Geodetic longitude 1 is the longitude of the begin point of the segment w.r.t WGS84.
Note: we don't need the coordinates of the endpoint, because airspaces are closed. The end point of a segment is the begin point of the next segment.
- Specified by:
readGeodeticLon1FromFmt3
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the geodetic longitude of the begin point of a segment
- See Also:
-
readRadius1FromFmt4
protected float readRadius1FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads the radius of an arc or circle segment from a record of format 04.All arc and circle segments have a non-empty value for radius 1. If this field is empty or non-numeric, an exception will be thrown.
- Specified by:
readRadius1FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- the radius of an arc or circle segment
-
readRadius2FromFmt4
protected float readRadius2FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads radius 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readRadius2FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- radius 2 of an arc or circle segment
-
readBearing1FromFmt4
protected float readBearing1FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads bearing 1 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readBearing1FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- bearing 1 of an arc or circle segment
-
readBearing2FromFmt4
protected float readBearing2FromFmt4(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoder
Reads bearing 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readBearing2FromFmt4
in classALcdDAFIFAirspaceDecoder
- Parameters:
aRecord
- the record to read from- Returns:
- bearing 2 of an arc or circle segment
-
setAirspaceDefaultDisplayNameIndex
public void setAirspaceDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the special use airspaces display name.- Parameters:
aIndex
- the index of the feature to be used as display name
-