Class TLcdASTERIXTrajectory
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdCurve,ILcdPointList,ILcdPointList2,ILcdPolyline,ILcdShape,ILcdTimeBounded,ILcdCache,ILcdCloneable,ILcdFeatured,Serializable,Cloneable
TLcdASTERIXTrajectory models the path of a track (for example an aircraft) flying
from one point to another. The path is discretized, and for every time stamp it contains
the location, heading and additional information of the track.
The number of steps in the discretization can be retrieved using getPointCount().
The locations can be retrieved using getPoint(int), the headings using getTrackHeading(int)
and the additional information is accessible through the getTrackFeature(int, int) method.- See Also:
-
Field Summary
Fields inherited from interface com.luciad.shape.ILcdCurve
INTERPOLATION_CIRCLE_BY_3POINTS, INTERPOLATION_CIRCLE_BY_CENTERPOINT, INTERPOLATION_CIRCULARARC_BY_3POINTS, INTERPOLATION_CIRCULARARC_BY_BULGE, INTERPOLATION_CIRCULARARC_BY_CENTERPOINT, INTERPOLATION_ELLIPTICAL, INTERPOLATION_GEODESIC, INTERPOLATION_LINEAR, INTERPOLATION_MIXED, INTERPOLATION_RHUMB -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSetFeature(int aIndex) Checks whether the specified feature is editable.voidClears the cache.clone()MakesObject.clone()public.voidcomputePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT) Computes a point of the curve, defined by the given parameter.booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 3D space.longThis method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds().Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.getCachedObject(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the type of this data object.Retrieves the end point of the curve.doubleReturns the angle of the curve's tangent at the end point, in degrees counterclockwise from the direction at 3 o'clock.longThis method acts as a shortcut method call to retrieve the end time of the time bounds fromgetTimeBounds().getFeature(int aIndex) Returns the featureObjectat the given index.intReturns the number of features.Returns the focus point of thisILcdShape.intgetIndexForTimeStamp(long aTimeStamp) Finds the index that corresponds to the given timestamp.Returns the interpolation method used by this curve.doublegetLength2D(double aParam1, double aParam2) Returns the length between two points of the curve, defined by the given parameters.intReturns the number of intersections between this curve and a line segment defined by the two specified points.getPoint(int aIndex) Returns theILcdPointat a given index.intReturns the number ofILcdPointobjects in the list.voidgetPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT) Stores the coordinates of the point ataIndexin the given point.Retrieves the start point of the curve.doubleReturns the angle of the curve's tangent at the start point, in degrees counterclockwise from the direction at 3 o'clock.doublegetTangent2D(double aParam) Returns the angle of the curve's tangent in the point defined by the given parameter, in degrees counterclockwise from the direction at 3 o'clock.longgetTime(int aIndex) Returns the time corresponding to the pointgetPoint(aIndex).Returns theILcdTimeBoundsby which this object is bounded.Returns theTLcdDataTypeof the tracks of this trajectory.getTrackFeature(int aIndex, int aFeatureIndex) Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.intReturns the number of features a track contains.doublegetTrackHeading(int aIndex) Returns the heading of the track at the given index.getTrackValue(int aIndex, TLcdDataProperty aProperty) Equivalent togetTrackFeature(int, int), but retrieves data objects instead of features.getValue(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.doublegetX(int aIndex) Returns the X coordinate of the point ataIndex.doublegetY(int aIndex) Returns the Y coordinate of the point ataIndex.doublegetZ(int aIndex) Returns the Z coordinate of the point ataIndex.booleanhasValue(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.booleanIndicates whether this data object has a value for the given property.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidsetFeature(int aIndex, Object aObject) Sets the featureObjectat the given index.voidsetTrackValue(int aIndex, TLcdDataProperty aProperty, Object aValue) Changes the track value for the given track property at the indicated index.voidsetValue(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.voidConvenience method that sets the value of the property with the given name.toString()
-
Method Details
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
getPointCount
public int getPointCount()Description copied from interface:ILcdPointListReturns the number ofILcdPointobjects in the list.- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- the number of
ILcdPointobjects in the list.
-
getPoint
Description copied from interface:ILcdPointListReturns theILcdPointat a given index.- Specified by:
getPointin interfaceILcdPointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.- Returns:
- the
ILcdPointat the given index. - Throws:
IndexOutOfBoundsException- if the given index is out of bounds.
-
getPointSFCT
Description copied from interface:ILcdPointListStores the coordinates of the point ataIndexin the given point.- Specified by:
getPointSFCTin interfaceILcdPointList- Parameters:
aIndex- the index of the point for which to retrieve the coordinates.aPointSFCT- the side-effect parameter in which to store the coordinates of the requested point.
-
getX
public double getX(int aIndex) Description copied from interface:ILcdPointListReturns the X coordinate of the point ataIndex.- Specified by:
getXin interfaceILcdPointList- Parameters:
aIndex- the index of the point for which to return the X coordinate.- Returns:
- the X coordinate of the point at
aIndex.
-
getY
public double getY(int aIndex) Description copied from interface:ILcdPointListReturns the Y coordinate of the point ataIndex.- Specified by:
getYin interfaceILcdPointList- Parameters:
aIndex- the index of the point for which to return the Y coordinate.- Returns:
- the Y coordinate of the point at
aIndex.
-
getZ
public double getZ(int aIndex) Description copied from interface:ILcdPointListReturns the Z coordinate of the point ataIndex.- Specified by:
getZin interfaceILcdPointList- Parameters:
aIndex- the index of the point for which to return the Z coordinate.- Returns:
- the Z coordinate of the point at
aIndex.
-
contains2D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 2D space. Only the first two dimensions of theILcdShapeand theILcdPointare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
computePointSFCT
Description copied from interface:ILcdCurveComputes a point of the curve, defined by the given parameter.- At parameter 0, the point is the same as
ILcdCurve.getStartPoint(). - At parameter 1, the point is the same as
ILcdCurve.getEndPoint().
- Specified by:
computePointSFCTin interfaceILcdCurve- Parameters:
aParam- a value of the closed interval [0,1]aPointSFCT- the point to store the computed curve point in
- At parameter 0, the point is the same as
-
getEndPoint
Description copied from interface:ILcdCurveRetrieves the end point of the curve.This is equivalent to
computePointSFCT(1).- Specified by:
getEndPointin interfaceILcdCurve- Returns:
- the end point of the curve
-
getEndTangent2D
public double getEndTangent2D()Description copied from interface:ILcdCurveReturns the angle of the curve's tangent at the end point, in degrees counterclockwise from the direction at 3 o'clock.The tangent orientation is from the end point, away from the curve before it.
This is the same as
getTangent2D(1).- Specified by:
getEndTangent2Din interfaceILcdCurve- Returns:
- the curve's angle in the end point
-
getInterpolation
Description copied from interface:ILcdCurveReturns the interpolation method used by this curve.A set of predefined constants are defined in this interface, which are used by the default
ILcdCurveimplementations provided by LuciadLightspeed.Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.
- Specified by:
getInterpolationin interfaceILcdCurve- Returns:
- the interpolation method used by this curve.
-
getLength2D
public double getLength2D(double aParam1, double aParam2) Description copied from interface:ILcdCurveReturns the length between two points of the curve, defined by the given parameters.- When
aParam1 == aParam2, the length is 0. - When
aParam1 == 0 and aParam2 == 1, the length is the whole length of the curve. - When
aParam1 > aParam2, the length is (aParam1 to 1) + (0 to aParam2).
- Specified by:
getLength2Din interfaceILcdCurve- Parameters:
aParam1- a value of the closed interval [0,1]aParam2- a value of the closed interval [0,1]- Returns:
- the length of the curve.
- When
-
getLineSegmentIntersectionCount
Description copied from interface:ILcdCurveReturns the number of intersections between this curve and a line segment defined by the two specified points.This information can be used to perform containment calculations, if this curve is closed or if this curve is part of a composite closed curve. By determining the number of intersections between this curve and a line segment starting from a given point in a fixed direction, one can determine whether a point is located within the closed curve by using the even-odd rule.
- Specified by:
getLineSegmentIntersectionCountin interfaceILcdCurve- Parameters:
aP1- the first point of the line segmentaP2- the second point of the line segment- Returns:
- the number of intersections between the curve and the line segment
-
getStartPoint
Description copied from interface:ILcdCurveRetrieves the start point of the curve.This is equivalent to
computePointSFCT(0).- Specified by:
getStartPointin interfaceILcdCurve- Returns:
- the start point of the curve
-
getStartTangent2D
public double getStartTangent2D()Description copied from interface:ILcdCurveReturns the angle of the curve's tangent at the start point, in degrees counterclockwise from the direction at 3 o'clock.The tangent orientation is from the start point towards the rest of the shape.
This is the same as
getTangent2D(0).- Specified by:
getStartTangent2Din interfaceILcdCurve- Returns:
- the curve's angle in the start point
-
getTangent2D
public double getTangent2D(double aParam) Description copied from interface:ILcdCurveReturns the angle of the curve's tangent in the point defined by the given parameter, in degrees counterclockwise from the direction at 3 o'clock.The tangent orientation is from the point at parameter
aParamtowards the rest of the shape.- The tangent at parameter 0 is the same as
ILcdCurve.getStartTangent2D(). - The tangent at parameter 1 is the same as
ILcdCurve.getEndTangent2D().
- Specified by:
getTangent2Din interfaceILcdCurve- Parameters:
aParam- a value of the closed interval [0,1]- Returns:
- the curve's angle in the point defined by the given parameter
- The tangent at parameter 0 is the same as
-
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.clone()public.java.lang.Object, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-
getTime
public long getTime(int aIndex) Returns the time corresponding to the pointgetPoint(aIndex). It is specified as a value in milliseconds since 1970, similar toDate.getTime().- Parameters:
aIndex- The index of the point for which you want to know the time. This index corresponds to the index ingetPoint(int aIndex)- Returns:
- The time when the aircraft was at getPoint(aIndex).
-
getIndexForTimeStamp
public int getIndexForTimeStamp(long aTimeStamp) Finds the index that corresponds to the given timestamp. More strictly speaking, it returns the index for which this condition holds:getTime( returned_index )<= aTimeStamp <getTime( returned_index + 1 ). Note that if 'returned_index' equalsgetPointCount()-1 (largest possible index),getTime( returned_index )== aTimeStamp. If the given time stamp is not in the interval [getBeginTime(),getEndTime()], -1 is returned.- Parameters:
aTimeStamp- The timestamp for which the index is requested.- Returns:
- The index in the trajectory that corresponds with aTimeStamp. -1 is returned when the time stamp could not be located.
- See Also:
-
getTimeBounds
Description copied from interface:ILcdTimeBoundedReturns theILcdTimeBoundsby which this object is bounded.- Specified by:
getTimeBoundsin interfaceILcdTimeBounded- Returns:
- the
ILcdTimeBoundsby which this object is bounded.
-
getBeginTime
public long getBeginTime()This method acts as a shortcut method call to retrieve the begin time of the time bounds fromgetTimeBounds().- Returns:
- the begin time of the trajectory.
- See Also:
-
getEndTime
public long getEndTime()This method acts as a shortcut method call to retrieve the end time of the time bounds fromgetTimeBounds().- Returns:
- the end time of the trajectory.
- See Also:
-
getTrackHeading
public double getTrackHeading(int aIndex) Returns the heading of the track at the given index. The heading should be interpreted as a clockwise angle in degrees starting from 12 o'clock. It returnsDouble.NaNif no heading is available. Note: useDouble.isNaNto check if a value isDouble.NaN.- Parameters:
aIndex- The index to retrieve the heading value for. 0 <= aIndex <= getPointCount().- Returns:
- The heading of the track at the given index.
-
getTrackFeature
Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.- Parameters:
aIndex- The index for the point for which you want to know the feature value. This index corresponds to the index ingetPoint(int aIndex).aFeatureIndex- Determines what particular feature value you want to retrieve. Must be smaller thangetTrackFeatureCount().- Returns:
- The requested feature at the specified point.
-
getTrackValue
Equivalent togetTrackFeature(int, int), but retrieves data objects instead of features.- Parameters:
aIndex- The index for the point for which you want to know the feature value. This index corresponds to the index ingetPoint(int aIndex)aProperty- The property of the track of which the value needs to be retrieved. The given property must be declared in the data type of the track, which can be retrieved usinggetTrackDataType()- Returns:
- The value of the property at the specified point.
- Throws:
IllegalArgumentException- if the given property was not declared in the data type of the tracks. SeegetTrackDataType()
-
setTrackValue
Changes the track value for the given track property at the indicated index.
Not all properties can be changed. Please refer to the developer's guide to see which properties exactly can be changed.
- Parameters:
aIndex- The trajectory index where you want the track value to change. Must be between 0 andgetPointCount().aProperty- The track property whose value you want to change. Must not benulland should be a property defined by the track data type.aValue- The new value you want the track property to have. Should correspond to the type of the given property.- Throws:
IllegalArgumentException- if the given property was not declared in the data type of the tracks. SeegetTrackDataType()- Since:
- 2013.0.14
- See Also:
-
getTrackDataType
Returns theTLcdDataTypeof the tracks of this trajectory.- Returns:
- The data type of the track, or null if the data type could not be determined.
-
getTrackFeatureCount
public int getTrackFeatureCount()Returns the number of features a track contains.- Returns:
- The number of features a track contains.
-
getFeatureCount
public int getFeatureCount()Description copied from interface:ILcdFeaturedReturns the number of features.- Specified by:
getFeatureCountin interfaceILcdFeatured- Returns:
- the number of features.
-
getFeature
Description copied from interface:ILcdFeaturedReturns the featureObjectat the given index.- Specified by:
getFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.- Returns:
- the feature
Objectat the given index. - Throws:
IndexOutOfBoundsException- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
setFeature
Description copied from interface:ILcdFeaturedSets the featureObjectat the given index.- Specified by:
setFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.aObject- the new featureObject.- Throws:
IllegalArgumentException- if the feature can't be set.- See Also:
-
canSetFeature
public boolean canSetFeature(int aIndex) Description copied from interface:ILcdFeaturedChecks whether the specified feature is editable.- Specified by:
canSetFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.- Returns:
- true if the feature can be set, false otherwise.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein interfaceILcdCache- Parameters:
aKey- the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself:insertIntoCache(this, ...).aObject- the Object to be cached.
-
getCachedObject
Description copied from interface:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin interfaceILcdCache- Parameters:
aKey- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-
toString
-
getValue
Description copied from interface:ILcdDataObjectReturns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the
data object's typeor in one of its super types. Otherwise anIllegalArgumentExceptionis thrown.- Specified by:
getValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be returned- Returns:
- the value of the given property for this data object
-
getDataType
Description copied from interface:ILcdDataObjectReturns the type of this data object. This can never benull.- Specified by:
getDataTypein interfaceILcdDataObject- Returns:
- the type of this data object
-
setValue
Description copied from interface:ILcdDataObjectSets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's typeor in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw anIllegalArgumentException.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be setaValue- the value to set- See Also:
-
getValue
Description copied from interface:ILcdDataObjectConvenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)for more information.- Specified by:
getValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property of which the value is to be returned- Returns:
- the value of the property with the given name
- See Also:
-
setValue
Description copied from interface:ILcdDataObjectConvenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)for more information.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property of which the value is to be setaValue- the value to set
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.aPropertyis from theright data type, and this instance has a value for it: returnstrueaPropertyis from theright data type, and this instance has no value for it: returnsfalseaPropertyis not from theright data type: not allowed, you will get IllegalArgumentExceptionaPropertyisnull: not allowed, you will get NullPointerException
- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the given property,falseotherwise.
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)for more information.- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the property with the given name,falseotherwise.
-