public class TLcdDAFIFAirspaceDecoder extends ALcdDAFIFAirspaceDecoder implements ILcdDAFIFSubTypeFilteringDecoder
ALcdDAFIFAirspaceDecoder
decodes
airspaces from a DAFIF source file. Decoded models have as model descriptor
an instance of TLcdDAFIFAirspaceModelDescriptor
. If subtype filtering
is enabled (via setSubTypesToDecode(int[])
), the decoder will produce a
TLcdModelList
with a TLcdDAFIFAirspaceModelListDescriptor
.
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.Airspace
,
which can also be retrieved through ILcdDataObject.getDataType()
.
The available properties of the objects are defined in TLcdDAFIFAirspaceDataProperties
.
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.
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 airspaces the key features are:
fAirspaceFeaturesToBeDecoded, FORMAT_1, FORMAT_2, FORMAT_3, FORMAT_4, FORMAT_5, FORMAT_6
DAFIF_PROP_EXTENSION, fRecordCount
Constructor and Description |
---|
TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory)
Deprecated.
|
TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory,
Properties aDAFIFProperties)
Deprecated.
|
TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
Constructs a new
TLcdDAFIFAirspaceDecoder object. |
TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory,
Properties aDAFIFProperties)
Creates a new
TLcdDAFIFAirspaceDecoder object. |
Modifier and Type | Method and Description |
---|---|
protected ILcdEditableAirspace |
createAirspace(char[] aRecord)
Creates and initializes an instance of an implementation of the
ILcdEditableAirspace interface. |
protected ILcdModelDescriptor |
createModelDescriptor(String aSource)
Creates and returns the model descriptor to be set on the model returned in the
decode method. |
ILcdModel |
decode(String aSource)
Overwrites the decode method.
|
Object[] |
getAvailableSubTypes()
Get an array of enumerated values defining all subtypes of a given DAFIF feature type.
|
String |
getDecodeFileName()
Returns the name of the file to be decoded.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
int[] |
getSubTypesToDecode()
Returns the set of 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[] record)
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[] record)
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[] record)
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[] record)
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[] record)
Reads a segments shape from a record of format 03.
|
void |
setAirspaceDefaultDisplayNameIndex(int aIndex)
Specifies the index of the feature to be used as
display name.
|
void |
setDAFIFModelFilter(ILcdDAFIFModelFilter aFilter)
Specifies a filter to be used while creating the model.
|
void |
setSubTypesToDecode(int[] aTypes)
Set the set of airspace types to be decoded.
|
getAirspaceFeaturesToBeDecoded, handleRecord, retrieveAltitudeReference, retrieveAltitudeUnit, retrieveAltitudeValue, setAirspaceFeaturesToBeDecoded, setAirspaceTypeToFilter
cleanUp, setKeyFeatureNames
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
@Deprecated public TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory)
TLcdDAFIFAirspaceDecoder
object. The user
should specify which domainFactory he or she wants to use to create the airspaces.aFactory
- the factory to be used to create the airspacespublic TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFAirspaceDecoder
object. The user
should specify which factory he or she wants to use to create the airspaces.aFactory
- the factory to be used to create the airspaces@Deprecated public TLcdDAFIFAirspaceDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFAirspaceDecoder
object.aFactory
- the factory to be used to create the airspacesaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic TLcdDAFIFAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFAirspaceDecoder
object.aFactory
- the factory to be used to create the airspacesaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic Object[] getAvailableSubTypes()
setSubTypesToDecode(int[])
.getAvailableSubTypes
in interface ILcdDAFIFSubTypeFilteringDecoder
public void setSubTypesToDecode(int[] aTypes)
setSubTypesToDecode
in interface ILcdDAFIFSubTypeFilteringDecoder
aTypes
- an array of indices specifying which type of airspaces
will be decoded. If null
is passed, reset to the default types.public int[] getSubTypesToDecode()
By default, null
is returned, indicating
that all available airspace types are decoded.
getSubTypesToDecode
in interface ILcdDAFIFSubTypeFilteringDecoder
public void setDAFIFModelFilter(ILcdDAFIFModelFilter aFilter)
ILcdDAFIFDecoder
setDAFIFModelFilter
in interface ILcdDAFIFDecoder
setDAFIFModelFilter
in class ALcdDAFIFDecoder
aFilter
- an ILcdDAFIFModelFilter
to filter the model
objectspublic String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFDecoder
ILcdModelDecoder
.public String getDecodeFileName()
ILcdDAFIFDecoder
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.
getDecodeFileName
in interface ILcdDAFIFDecoder
protected ILcdModelDescriptor createModelDescriptor(String aSource)
ALcdDAFIFSingleModelDecoder
decode
method.createModelDescriptor
in class ALcdDAFIFSingleModelDecoder
aSource
- the source that will be used to decodepublic ILcdModel decode(String aSource) throws IOException
If the traceOn property is true, this decode method will output extra trace info.
decode
in interface ILcdModelDecoder
decode
in class ALcdDAFIFAirspaceDecoder
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)IOException
- if an error occurs during the reading processILcdModelDecoder.canDecodeSource(String)
protected ILcdEditableAirspace createAirspace(char[] aRecord)
ALcdDAFIFAirspaceDecoder
ILcdEditableAirspace
interface.createAirspace
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to retrieve information fromprotected void handleRecordFmt2(char[] aRecord)
ALcdDAFIFAirspaceDecoder
handleRecordFmt2
in class ALcdDAFIFAirspaceDecoder
aRecord
- a record of format 02protected String readAirspaceUID(char[] aRecord)
ALcdDAFIFAirspaceDecoder
This unique identifier may consist of
one or more features. The resulting String
object is a concatenation of
these feature values.
readAirspaceUID
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected char readShapeFromFmt3(char[] record)
ALcdDAFIFAirspaceDecoder
readShapeFromFmt3
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromprotected double readLon0FromFmt3(char[] aRecord)
ALcdDAFIFAirspaceDecoder
The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.
readLon0FromFmt3
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected double readLat0FromFmt3(char[] aRecord)
ALcdDAFIFAirspaceDecoder
The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. a user specified geodetic datum.
readLat0FromFmt3
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected double readGeodeticLat0FromFmt4(char[] record)
ALcdDAFIFAirspaceDecoder
The latitude 0 is the latitude of the center point of an arc or circle segment w.r.t. WGS84.
readGeodeticLat0FromFmt4
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromALcdDAFIFAirspaceDecoder.readLat0FromFmt3(char[])
protected double readGeodeticLon0FromFmt4(char[] record)
ALcdDAFIFAirspaceDecoder
The longitude 0 is the longitude of the center point of an arc or circle segment w.r.t. WGS84.
readGeodeticLon0FromFmt4
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromALcdDAFIFAirspaceDecoder.readLon0FromFmt3(char[])
protected double readLat1FromFmt3(char[] record)
ALcdDAFIFAirspaceDecoder
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.
readLat1FromFmt3
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromprotected double readLon1FromFmt3(char[] record)
ALcdDAFIFAirspaceDecoder
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.
readLon1FromFmt3
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromprotected int readSegmentNumber(char[] record)
ALcdDAFIFAirspaceDecoder
readSegmentNumber
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromprotected double readGeodeticLon1FromFmt3(char[] aRecord)
ALcdDAFIFAirspaceDecoder
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.
readGeodeticLon1FromFmt3
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromALcdDAFIFAirspaceDecoder.readLon1(char[])
protected double readGeodeticLat1FromFmt3(char[] aRecord)
ALcdDAFIFAirspaceDecoder
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.
readGeodeticLat1FromFmt3
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromALcdDAFIFAirspaceDecoder.readLat1(char[])
protected float readRadius1FromFmt4(char[] aRecord)
ALcdDAFIFAirspaceDecoder
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.
readRadius1FromFmt4
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected float readRadius2FromFmt4(char[] aRecord)
ALcdDAFIFAirspaceDecoder
This field may be empty.
readRadius2FromFmt4
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected float readBearing1FromFmt4(char[] aRecord)
ALcdDAFIFAirspaceDecoder
This field may be empty.
readBearing1FromFmt4
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected float readBearing2FromFmt4(char[] aRecord)
ALcdDAFIFAirspaceDecoder
This field may be empty.
readBearing2FromFmt4
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected String readNavaidUIDFromFmt4(char[] aRecord)
ALcdDAFIFAirspaceDecoder
readNavaidUIDFromFmt4
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read frompublic void setAirspaceDefaultDisplayNameIndex(int aIndex)
aIndex
- the index of the feature to be used as display name