public class TLcdDAFIFSpecialUseAirspaceDecoder extends ALcdDAFIFAirspaceDecoder implements ILcdDAFIFSubTypeFilteringDecoder
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.
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:
fAirspaceFeaturesToBeDecoded, FORMAT_1, FORMAT_2, FORMAT_3, FORMAT_4, FORMAT_5, FORMAT_6
DAFIF_PROP_EXTENSION, fRecordCount
Constructor and Description |
---|
TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory)
Deprecated.
|
TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory,
Properties aDAFIFProperties)
Deprecated.
|
TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
Constructs a new
TLcdDAFIFSpecialUseAirspaceDecoder object. |
TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory,
Properties aDAFIFProperties)
Constructs a new
TLcdDAFIFSpecialUseAirspaceDecoder 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 aSourceName)
Calls the decode method of
ALcdDAFIFSingleModelDecoder class. |
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 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 the
decode 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.
|
getAirspaceFeaturesToBeDecoded, handleRecord, retrieveAltitudeReference, retrieveAltitudeUnit, retrieveAltitudeValue, 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 TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory)
TLcdDAFIFSpecialUseAirspaceDecoder
object. The user
should specify which domainFactory he or she wants to use to create the special use airspaces.aFactory
- the factory to be used to create the model objectspublic TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFSpecialUseAirspaceDecoder
object. The user
should specify which factory he or she wants to use to create the special use airspaces.aFactory
- the factory to be used to create the model objects@Deprecated public TLcdDAFIFSpecialUseAirspaceDecoder(ALcdAISObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFSpecialUseAirspaceDecoder
object. The user
should specify which domainFactory he or she wants to use to create the special use airspaces.aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic TLcdDAFIFSpecialUseAirspaceDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFSpecialUseAirspaceDecoder
object. The user
should specify which factory he or she wants to use to create the special use airspaces.aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic ILcdModel decode(String aSourceName) throws IOException
ALcdDAFIFAirspaceDecoder
ALcdDAFIFSingleModelDecoder
class. Prints
additional information about the number of segments to the log.decode
in interface ILcdModelDecoder
decode
in class ALcdDAFIFAirspaceDecoder
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)IOException
- if an error occurs during the reading processILcdModelDecoder.canDecodeSource(String)
public void setDAFIFModelFilter(ILcdDAFIFModelFilter aFilter)
ILcdDAFIFDecoder
setDAFIFModelFilter
in interface ILcdDAFIFDecoder
setDAFIFModelFilter
in class ALcdDAFIFDecoder
aFilter
- an ILcdDAFIFModelFilter
to filter the model
objectspublic 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 airspace
will be decoded. If null
is passed, reset to the default types.public int[] getSubTypesToDecode()
getSubTypesToDecode
in interface ILcdDAFIFSubTypeFilteringDecoder
public 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 void setAirspaceFeaturesToBeDecoded(String[] aFeaturesToBeDecoded)
decode
method.
Please make sure that the BOUNDARY_IDENTIFICATION
feature,
and the SECTOR
feature are in your list.
If you want to filter on an airspace type, you should also include
the TYPE
feature into your list.
setAirspaceFeaturesToBeDecoded
in class ALcdDAFIFAirspaceDecoder
aFeaturesToBeDecoded
- a list of features that should be decoded into the special use airspace objectsprotected ILcdEditableAirspace createAirspace(char[] aRecord)
ALcdDAFIFAirspaceDecoder
ILcdEditableAirspace
interface.createAirspace
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to retrieve information fromprotected 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 void handleRecordFmt2(char[] aRecord)
ALcdDAFIFAirspaceDecoder
handleRecordFmt2
in class ALcdDAFIFAirspaceDecoder
aRecord
- a record of format 02protected int readSegmentNumber(char[] record)
ALcdDAFIFAirspaceDecoder
readSegmentNumber
in class ALcdDAFIFAirspaceDecoder
record
- the record to read fromprotected char readShapeFromFmt3(char[] aRecord)
ALcdDAFIFAirspaceDecoder
readShapeFromFmt3
in class ALcdDAFIFAirspaceDecoder
aRecord
- the record to read fromprotected double readLat1FromFmt3(char[] aRecord)
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
aRecord
- the record to read fromprotected double readLon1FromFmt3(char[] aRecord)
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
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 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 readGeodeticLat0FromFmt4(char[] aRecord)
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
aRecord
- the record to read fromALcdDAFIFAirspaceDecoder.readLat0FromFmt3(char[])
protected double readGeodeticLon0FromFmt4(char[] aRecord)
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
aRecord
- the record to read fromALcdDAFIFAirspaceDecoder.readLon0FromFmt3(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 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 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