Class ALcdDAFIFAirspaceDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder,ILcdInputStreamFactoryCapable,ILcdModelDecoder
- Direct Known Subclasses:
TLcdDAFIFAirspaceDecoder,TLcdDAFIFSpecialUseAirspaceDecoder
ALcdDAFIFSingleModelDecoder defines
the skeleton of the decode algorithm used to decode DAFIF airspaces and
special use airspaces.
Airspace and special use airspace records contain mostly the same information, but the fields do not start at the same positions. That's why the most of the read methods are abstract methods.
Also, the structure of airspaces and special use airspaces is different. Airspaces consist
of segments while special use airspaces consist of sectors. Each sector is an airspace, so
it consists of segments.
That's why the createEditableAirspace method is left as an abstract method.
Extensions of the ALcdDAFIFAirspaceDecoder class allow the user to filter on
the airspace operations type.
If an airspace type is specified, the model will only contain those airspaces that have the
specified filter value as the value of their TYPE feature.
Please remark that if the you want to filter on an airspace type, you have to specify the
ILcdAirspaceFeature.TYPE feature in your
list of features to be decoded.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]The names of the features to be decoded.protected static final intRecord type format 01.protected static final intRecord type format 02.protected static final intRecord type format 03.protected static final intRecord type format 04.protected static final intRecord type format 05.protected static final intRecord type format 06.Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount -
Constructor Summary
ConstructorsConstructorDescriptionALcdDAFIFAirspaceDecoder(Properties aDAFIFProperties) Initializes the DAFIFProperties field with the specified properties object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ILcdEditableAirspacecreateAirspace(char[] aRecord) Creates and initializes an instance of an implementation of theILcdEditableAirspaceinterface.Calls the decode method ofALcdDAFIFSingleModelDecoderclass.protected String[]Returns the features currently selected for decoding into the model objects.protected voidhandleRecord(int aFormat, char[] aRecord) Deals with one record of input.protected abstract voidhandleRecordFmt2(char[] aRecord) Deals with the information found in a record of format 02.protected abstract StringreadAirspaceUID(char[] aRecord) Reads the unique identifier of an airspace.protected abstract floatreadBearing1FromFmt4(char[] aRecord) Reads bearing 1 of an arc or circle segment from a record of format 04.protected abstract floatreadBearing2FromFmt4(char[] aRecord) Reads bearing 2 of an arc or circle segment from a record of format 04.protected abstract doublereadGeodeticLat0FromFmt4(char[] record) Reads a segments geodetic latitude from a record of format 04.protected abstract doublereadGeodeticLat1FromFmt3(char[] aRecord) Reads a segments geodetic latitude 1 from a aRecord of format 03.protected abstract doublereadGeodeticLon0FromFmt4(char[] aRecord) Reads a segments geodetic longitude 0 from a record of format 04.protected abstract doublereadGeodeticLon1FromFmt3(char[] aRecord) Reads a segments geodetic longitude 1 from a aRecord of format 03.protected abstract doublereadLat0FromFmt3(char[] aRecord) Reads a segments latitude 0 from a record of format 03.protected abstract doublereadLat1FromFmt3(char[] aRecord) Reads a segments latitude 1 from a record of format 03.protected abstract doublereadLon0FromFmt3(char[] aRecord) Reads a segments longitude 0 from a record of format 03.protected abstract doublereadLon1FromFmt3(char[] aRecord) Reads a segments longitude 1 from a record of format 03.protected abstract StringreadNavaidUIDFromFmt4(char[] aRecord) Reads the unique identifier of a navaid.protected abstract floatreadRadius1FromFmt4(char[] aRecord) Reads the radius of an arc or circle segment from a record of format 04.protected abstract floatreadRadius2FromFmt4(char[] aRecord) Reads radius 2 of an arc or circle segment from a record of format 04.protected abstract intreadSegmentNumber(char[] aRecord) Reads the segment number.protected abstract charreadShapeFromFmt3(char[] aRecord) Reads a segments shape from a record of format 03.protected TLcdAltitudeReferenceretrieveAltitudeReference(String aAltitudeString) Returns aTLcdAltitudeReferenceobject representing the reference of the given altitude.protected TLcdAltitudeUnitretrieveAltitudeUnit(String aAltitudeString) Returns aTLcdAltitudeUnitobject representing the unit of the given altitude.protected FloatretrieveAltitudeValue(String aAltitudeString) Returns aFloatrepresenting the numerical value of the given altitude.voidsetAirspaceFeaturesToBeDecoded(String[] aAirspaceFeaturesToBeDecoded) Specifies the features to be decoded into the model objects.voidsetAirspaceTypeToFilter(TLcdAirspaceType aAirspaceTypeToFilter) Sets the airspace type to be filtered on, i.e., the decode method will only put airspaces of the chosen type in the decoded model.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, createModelDescriptor, setKeyFeatureNamesMethods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
addErrorReport, canDecodeSource, getAltitudeType, getBearingTypeForChar, getBounds, getDAFIFProperties, getDataObjectFactory, getDecodingBounds, getDisplayName, getDomainFactory, getErrorMessage, getInputStream, getInputStreamFactory, getLocalHorizontalDatum, getModelFilter, getRecordCount, initializeErrorMessage, isStoreOriginalReference, isTraceOn, loadCFGProperties, read, readExactValue, readFormat, readMinLength, readRecord, setBounds, setDAFIFModelFilter, 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.format.dafif.decoder.ILcdDAFIFDecoder
getDecodeFileNameMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
FORMAT_1
protected static final int FORMAT_1Record type format 01.- See Also:
-
FORMAT_2
protected static final int FORMAT_2Record type format 02.- See Also:
-
FORMAT_3
protected static final int FORMAT_3Record type format 03.- See Also:
-
FORMAT_4
protected static final int FORMAT_4Record type format 04.- See Also:
-
FORMAT_5
protected static final int FORMAT_5Record type format 05.- See Also:
-
FORMAT_6
protected static final int FORMAT_6Record type format 06.- See Also:
-
fAirspaceFeaturesToBeDecoded
The names of the features to be decoded.
-
-
Constructor Details
-
ALcdDAFIFAirspaceDecoder
Initializes the DAFIFProperties field with the specified properties object. This object may be null.If you don't have a properties object here, you can still specify it by decoding a .toc file containing the dafif properties. The decoder will read the properties from the .toc file and look for the data file to be decoded in the directory containing this .toc file.
- Parameters:
aDAFIFProperties- aPropertiesobject containing for each domain object the name of its data file or NULL
-
-
Method Details
-
decode
Calls the decode method ofALcdDAFIFSingleModelDecoderclass. Prints additional information about the number of segments to the log.- Specified by:
decodein interfaceILcdModelDecoder- Overrides:
decodein classALcdDAFIFSingleModelDecoder- Parameters:
aSource- 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:
-
handleRecord
protected void handleRecord(int aFormat, char[] aRecord) Description copied from class:ALcdDAFIFSingleModelDecoderDeals with one record of input.- Specified by:
handleRecordin classALcdDAFIFSingleModelDecoder- Parameters:
aFormat- the format of the recordaRecord- the record
-
setAirspaceTypeToFilter
Sets the airspace type to be filtered on, i.e., the decode method will only put airspaces of the chosen type in the decoded model.If aAirspaceTypeToFilter is null, the decode method will put all airspaces in the model.
- Parameters:
aAirspaceTypeToFilter- the airspace type to be filtered on
-
setAirspaceFeaturesToBeDecoded
Specifies the features to be decoded into the model objects.Please add the
BOUNDARY_IDENTIFICATIONfeature to your list.If you want to filter on an airspace type, you should also include the
ILcdAirspaceFeature.TYPEfeature into your list.- Parameters:
aAirspaceFeaturesToBeDecoded- a list of features that should be decoded into the airspace objects
-
getAirspaceFeaturesToBeDecoded
Returns the features currently selected for decoding into the model objects.- Returns:
- the features currently selected for decoding into the model objects
- See Also:
-
retrieveAltitudeValue
Returns aFloatrepresenting the numerical value of the given altitude.- Parameters:
aAltitudeString- aStringrepresenting an altitude- Returns:
- a
Floatrepresenting the numerical value of the given altitude
-
retrieveAltitudeUnit
Returns aTLcdAltitudeUnitobject representing the unit of the given altitude.- Parameters:
aAltitudeString- aStringrepresenting an altitude- Returns:
- a
TLcdAltitudeUnitobject representing the unit of the given altitude
-
retrieveAltitudeReference
Returns aTLcdAltitudeReferenceobject representing the reference of the given altitude.- Parameters:
aAltitudeString- aStringrepresenting an altitude- Returns:
- a
TLcdAltitudeReferenceobject representing the reference of the given altitude
-
createAirspace
Creates and initializes an instance of an implementation of theILcdEditableAirspaceinterface.- Parameters:
aRecord- the record to retrieve information from
-
handleRecordFmt2
protected abstract void handleRecordFmt2(char[] aRecord) Deals with the information found in a record of format 02.- Parameters:
aRecord- a record of format 02
-
readAirspaceUID
Reads 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.- Parameters:
aRecord- the record to read from- Returns:
- the unique identifier of an airspace
-
readSegmentNumber
protected abstract int readSegmentNumber(char[] aRecord) Reads the segment number.- Parameters:
aRecord- the record to read from- Returns:
- the segment sequence number
-
readLon1FromFmt3
protected abstract double readLon1FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the longitude of the begin point of a segment
-
readLat1FromFmt3
protected abstract double readLat1FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the latitude of the begin point of a segment
-
readGeodeticLon1FromFmt3
protected abstract double readGeodeticLon1FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the geodetic longitude of the begin point of a segment
- See Also:
-
readGeodeticLat1FromFmt3
protected abstract double readGeodeticLat1FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the geodetic latitude of the begin point of a segment
- See Also:
-
readLon0FromFmt3
protected abstract double readLon0FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the longitude of the center point of an arc or circle segment
-
readLat0FromFmt3
protected abstract double readLat0FromFmt3(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the latitude of the center point of an arc or circle segment
-
readGeodeticLon0FromFmt4
protected abstract double readGeodeticLon0FromFmt4(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the geodetic longitude of the center point of an arc or circle segment
- See Also:
-
readGeodeticLat0FromFmt4
protected abstract double readGeodeticLat0FromFmt4(char[] record) 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.
- Parameters:
record- the record to read from- Returns:
- the geodetic latitude of the center point of an arc or circle segment
- See Also:
-
readShapeFromFmt3
protected abstract char readShapeFromFmt3(char[] aRecord) Reads a segments shape from a record of format 03.- Parameters:
aRecord- the record to read from- Returns:
- a character that describes the shape of the segment (circle, arc, geodesic line, ...).
-
readRadius1FromFmt4
protected abstract float readRadius1FromFmt4(char[] aRecord) 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.
- Parameters:
aRecord- the record to read from- Returns:
- the radius of an arc or circle segment
-
readRadius2FromFmt4
protected abstract float readRadius2FromFmt4(char[] aRecord) Reads radius 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Parameters:
aRecord- the record to read from- Returns:
- radius 2 of an arc or circle segment
-
readBearing1FromFmt4
protected abstract float readBearing1FromFmt4(char[] aRecord) Reads bearing 1 of an arc or circle segment from a record of format 04.This field may be empty.
- Parameters:
aRecord- the record to read from- Returns:
- bearing 1 of an arc or circle segment
-
readBearing2FromFmt4
protected abstract float readBearing2FromFmt4(char[] aRecord) Reads bearing 2 of an arc or circle segment from a record of format 04.This field may be empty.
- Parameters:
aRecord- the record to read from- Returns:
- bearing 2 of an arc or circle segment
-