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_6Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties) Deprecated.Constructs a newTLcdDAFIFSpecialUseAirspaceDecoderobject.TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFSpecialUseAirspaceDecoderobject. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdEditableAirspacecreateAirspace(char[] aRecord) Creates and initializes an instance of an implementation of theILcdEditableAirspaceinterface.protected ILcdModelDescriptorcreateModelDescriptor(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecodemethod.Calls the decode method ofALcdDAFIFSingleModelDecoderclass.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 voidhandleRecordFmt2(char[] aRecord) Deals with the information found in a record of format 02.protected StringreadAirspaceUID(char[] aRecord) Reads the unique identifier of an airspace.protected floatreadBearing1FromFmt4(char[] aRecord) Reads bearing 1 of an arc or circle segment from a record of format 04.protected floatreadBearing2FromFmt4(char[] aRecord) Reads bearing 2 of an arc or circle segment from a record of format 04.protected doublereadGeodeticLat0FromFmt4(char[] aRecord) Reads a segments geodetic latitude from a record of format 04.protected doublereadGeodeticLat1FromFmt3(char[] aRecord) Reads a segments geodetic latitude 1 from a aRecord of format 03.protected doublereadGeodeticLon0FromFmt4(char[] aRecord) Reads a segments geodetic longitude 0 from a record of format 04.protected doublereadGeodeticLon1FromFmt3(char[] aRecord) Reads a segments geodetic longitude 1 from a aRecord of format 03.protected doublereadLat0FromFmt3(char[] aRecord) Reads a segments latitude 0 from a record of format 03.protected doublereadLat1FromFmt3(char[] aRecord) Reads a segments latitude 1 from a record of format 03.protected doublereadLon0FromFmt3(char[] aRecord) Reads a segments longitude 0 from a record of format 03.protected doublereadLon1FromFmt3(char[] aRecord) Reads a segments longitude 1 from a record of format 03.protected StringreadNavaidUIDFromFmt4(char[] aRecord) Reads the unique identifier of a navaid.protected floatreadRadius1FromFmt4(char[] aRecord) Reads the radius of an arc or circle segment from a record of format 04.protected floatreadRadius2FromFmt4(char[] aRecord) Reads radius 2 of an arc or circle segment from a record of format 04.protected intreadSegmentNumber(char[] record) Reads the segment number.protected charreadShapeFromFmt3(char[] aRecord) Reads a segments shape from a record of format 03.voidsetAirspaceDefaultDisplayNameIndex(int aIndex) Specifies the index of the feature to be the special use airspaces display name.voidsetAirspaceFeaturesToBeDecoded(String[] aFeaturesToBeDecoded) Specifies the features that should be decoded into the special use airspace objects of the model that will be returned by thedecodemethod.voidsetDAFIFModelFilter(ILcdDAFIFModelFilter aFilter) Specifies a filter to be used while creating the model.voidsetSubTypesToDecode(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, setAirspaceTypeToFilterMethods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNamesMethods 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, transformPointToReferenceDatumSFCTMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdDAFIFSpecialUseAirspaceDecoder
Deprecated.Constructs a newTLcdDAFIFSpecialUseAirspaceDecoderobject. 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 newTLcdDAFIFSpecialUseAirspaceDecoderobject. 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 newTLcdDAFIFSpecialUseAirspaceDecoderobject. 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- aPropertiesobject that contains for each domain object the appropriate file name
-
TLcdDAFIFSpecialUseAirspaceDecoder
public TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Constructs a newTLcdDAFIFSpecialUseAirspaceDecoderobject. 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- aPropertiesobject that contains for each domain object the appropriate file name
-
-
Method Details
-
decode
Description copied from class:ALcdDAFIFAirspaceDecoderCalls the decode method ofALcdDAFIFSingleModelDecoderclass. Prints additional information about the number of segments to the log.- Specified by:
decodein interfaceILcdModelDecoder- Overrides:
decodein 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:ILcdDAFIFDecoderSpecifies 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:
setDAFIFModelFilterin interfaceILcdDAFIFDecoder- Overrides:
setDAFIFModelFilterin classALcdDAFIFDecoder- Parameters:
aFilter- anILcdDAFIFModelFilterto 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:
getAvailableSubTypesin 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:
setSubTypesToDecodein interfaceILcdDAFIFSubTypeFilteringDecoder- Parameters:
aTypes- an array of indices specifying which type of airspace will be decoded. Ifnullis passed, reset to the default types.
-
getSubTypesToDecode
public int[] getSubTypesToDecode()Returns the set of special use airspace types to be decoded.- Specified by:
getSubTypesToDecodein interfaceILcdDAFIFSubTypeFilteringDecoder- Returns:
- the set of special use airspace types to be decoded.
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Overrides:
getDisplayNamein classALcdDAFIFDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
getDecodeFileName
Description copied from interface:ILcdDAFIFDecoderReturns 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:
getDecodeFileNamein interfaceILcdDAFIFDecoder- Returns:
- the name of the source file
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoderCreates and returns the model descriptor to be set on the model returned in thedecodemethod.- Specified by:
createModelDescriptorin 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 thedecodemethod.Please make sure that the
BOUNDARY_IDENTIFICATIONfeature, and theSECTORfeature are in your list.If you want to filter on an airspace type, you should also include the
TYPEfeature into your list.- Overrides:
setAirspaceFeaturesToBeDecodedin classALcdDAFIFAirspaceDecoder- Parameters:
aFeaturesToBeDecoded- a list of features that should be decoded into the special use airspace objects
-
createAirspace
Description copied from class:ALcdDAFIFAirspaceDecoderCreates and initializes an instance of an implementation of theILcdEditableAirspaceinterface.- Specified by:
createAirspacein classALcdDAFIFAirspaceDecoder- Parameters:
aRecord- the record to retrieve information from
-
readAirspaceUID
Description copied from class:ALcdDAFIFAirspaceDecoderReads the unique identifier of an airspace.This unique identifier may consist of one or more features. The resulting
Stringobject is a concatenation of these feature values.- Specified by:
readAirspaceUIDin 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:ALcdDAFIFAirspaceDecoderDeals with the information found in a record of format 02.- Specified by:
handleRecordFmt2in classALcdDAFIFAirspaceDecoder- Parameters:
aRecord- a record of format 02
-
readSegmentNumber
protected int readSegmentNumber(char[] record) Description copied from class:ALcdDAFIFAirspaceDecoderReads the segment number.- Specified by:
readSegmentNumberin classALcdDAFIFAirspaceDecoder- Parameters:
record- the record to read from- Returns:
- the segment sequence number
-
readShapeFromFmt3
protected char readShapeFromFmt3(char[] aRecord) Description copied from class:ALcdDAFIFAirspaceDecoderReads a segments shape from a record of format 03.- Specified by:
readShapeFromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readLat1FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readLon1FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readLat0FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readLon0FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readGeodeticLat0FromFmt4in 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:ALcdDAFIFAirspaceDecoderReads 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:
readGeodeticLon0FromFmt4in 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:ALcdDAFIFAirspaceDecoderReads 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:
readGeodeticLat1FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readGeodeticLon1FromFmt3in 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:ALcdDAFIFAirspaceDecoderReads 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:
readRadius1FromFmt4in 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:ALcdDAFIFAirspaceDecoderReads radius 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readRadius2FromFmt4in 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:ALcdDAFIFAirspaceDecoderReads bearing 1 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readBearing1FromFmt4in 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:ALcdDAFIFAirspaceDecoderReads bearing 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Specified by:
readBearing2FromFmt4in 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
-