public class TLcdASTERIXTrajectory extends Object implements ILcdPointList,ILcdPointList2, ILcdPolyline, ILcdBounded,ILcdFeatured, ILcdCache, ILcdTimeBounded, ILcdDataObject, ILcdCurve
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.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
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Checks whether the specified feature is editable.
|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Makes
Object.clone() public. |
void |
computePointSFCT(double aParam,
ILcd3DEditablePoint aPointSFCT)
Computes a point of the curve, defined by the given parameter.
|
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
contains3D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 3D space. |
long |
getBeginTime()
This method acts as a shortcut method call to retrieve the begin
time of the time bounds from
getTimeBounds() . |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
ILcdPoint |
getEndPoint()
Retrieves the end point of the curve.
|
double |
getEndTangent2D()
Returns the angle of the curve's tangent at the end point,
in degrees counterclockwise from the direction at 3 o'clock.
|
long |
getEndTime()
This method acts as a shortcut method call to retrieve the end
time of the time bounds from
getTimeBounds() . |
Object |
getFeature(int aIndex)
Returns the feature
Object at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
int |
getIndexForTimeStamp(long aTimeStamp)
Finds the index that corresponds to the given timestamp.
|
String |
getInterpolation()
Returns the interpolation method used by this curve.
|
double |
getLength2D(double aParam1,
double aParam2)
Returns the length between two points of the curve,
defined by the given parameters.
|
int |
getLineSegmentIntersectionCount(ILcdPoint aP1,
ILcdPoint aP2)
Returns the number of intersections between this curve and a line segment
defined by the two specified points.
|
ILcdPoint |
getPoint(int aIndex)
Returns the
ILcdPoint at a given index. |
int |
getPointCount()
Returns the number of
ILcdPoint objects in the list. |
void |
getPointSFCT(int aIndex,
ILcd3DEditablePoint aPointSFCT)
Stores the coordinates of the point at
aIndex in the given point. |
ILcdPoint |
getStartPoint()
Retrieves the start point of the curve.
|
double |
getStartTangent2D()
Returns the angle of the curve's tangent at the start point,
in degrees counterclockwise from the direction at 3 o'clock.
|
double |
getTangent2D(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.
|
long |
getTime(int aIndex)
Returns the time corresponding to the point
getPoint(aIndex) . |
ILcdTimeBounds |
getTimeBounds()
Returns the
ILcdTimeBounds by which this object is bounded. |
TLcdDataType |
getTrackDataType()
Returns the
TLcdDataType of the tracks of this trajectory. |
Object |
getTrackFeature(int aIndex,
int aFeatureIndex)
Retrieves the track feature indicated by aFeatureIndex at the point indicated by aIndex.
|
int |
getTrackFeatureCount()
Returns the number of features a track contains.
|
double |
getTrackHeading(int aIndex)
Returns the heading of the track at the given index.
|
Object |
getTrackValue(int aIndex,
TLcdDataProperty aProperty)
Equivalent to
getTrackFeature(int, int) , but retrieves data objects instead of features. |
Object |
getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
double |
getX(int aIndex)
Returns the X coordinate of the point at
aIndex . |
double |
getY(int aIndex)
Returns the Y coordinate of the point at
aIndex . |
double |
getZ(int aIndex)
Returns the Z coordinate of the point at
aIndex . |
boolean |
hasValue(String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
Indicates whether this data object has a value for the given property.
|
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setFeature(int aIndex,
Object aObject)
Sets the feature
Object at the given index. |
void |
setTrackValue(int aIndex,
TLcdDataProperty aProperty,
Object aValue)
Changes the track value for the given track property at the indicated index.
|
void |
setValue(String aPropertyName,
Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
String |
toString() |
public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
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 undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public int getPointCount()
ILcdPointList
ILcdPoint
objects in the list.getPointCount
in interface ILcdPointList
ILcdPoint
objects in the list.public ILcdPoint getPoint(int aIndex) throws IndexOutOfBoundsException
ILcdPointList
ILcdPoint
at a given index.getPoint
in interface ILcdPointList
aIndex
- a valid index in the list of ILcdPoint
objects.ILcdPoint
at the given index.IndexOutOfBoundsException
- if the given index is out of bounds.public void getPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT)
ILcdPointList
aIndex
in the given point.getPointSFCT
in interface ILcdPointList
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.public double getX(int aIndex)
ILcdPointList
aIndex
.getX
in interface ILcdPointList
aIndex
- the index of the point for which to return the X coordinate.aIndex
.public double getY(int aIndex)
ILcdPointList
aIndex
.getY
in interface ILcdPointList
aIndex
- the index of the point for which to return the Y coordinate.aIndex
.public double getZ(int aIndex)
ILcdPointList
aIndex
.getZ
in interface ILcdPointList
aIndex
- the index of the point for which to return the Z coordinate.aIndex
.public boolean contains2D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 2D space.
Only the first two dimensions of the ILcdShape
and the ILcdPoint
are considered.contains2D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double aX, double aY)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains3D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aX, double aY, double aZ)
ILcdShape
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
ILcdCurve
ILcdCurve.getStartPoint()
.ILcdCurve.getEndPoint()
.computePointSFCT
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inpublic ILcdPoint getEndPoint()
ILcdCurve
This is equivalent to computePointSFCT(1)
.
getEndPoint
in interface ILcdCurve
public double getEndTangent2D()
ILcdCurve
The tangent orientation is from the end point, away from the curve before it.
This is the same as getTangent2D(1)
.
getEndTangent2D
in interface ILcdCurve
public String getInterpolation()
ILcdCurve
A set of predefined constants are defined in this interface,
which are used by the default ILcdCurve
implementations
provided by LuciadLightspeed.
Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.
getInterpolation
in interface ILcdCurve
public double getLength2D(double aParam1, double aParam2)
ILcdCurve
aParam1 == aParam2
, the length is 0.aParam1 == 0 and aParam2 == 1
, the length is the whole length of the curve.aParam1 > aParam2
, the length is (aParam1 to 1
) + (0 to aParam2
).getLength2D
in interface ILcdCurve
aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]public int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
ILcdCurve
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.
getLineSegmentIntersectionCount
in interface ILcdCurve
aP1
- the first point of the line segmentaP2
- the second point of the line segmentpublic ILcdPoint getStartPoint()
ILcdCurve
This is equivalent to computePointSFCT(0)
.
getStartPoint
in interface ILcdCurve
public double getStartTangent2D()
ILcdCurve
The tangent orientation is from the start point towards the rest of the shape.
This is the same as getTangent2D(0)
.
getStartTangent2D
in interface ILcdCurve
public double getTangent2D(double aParam)
ILcdCurve
The tangent orientation is from the point at parameter aParam
towards the rest of the shape.
ILcdCurve.getStartTangent2D()
.ILcdCurve.getEndTangent2D()
.getTangent2D
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]public Object clone()
ILcdCloneable
Makes Object.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 );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public long getTime(int aIndex)
getPoint(aIndex)
. It is
specified as a value in milliseconds since 1970, similar to Date.getTime()
.aIndex
- The index of the point for which you want to know the time. This index corresponds
to the index in getPoint(int aIndex)
public int getIndexForTimeStamp(long aTimeStamp)
getTime( returned_index )
<= aTimeStamp < getTime(
returned_index + 1 )
. Note that if 'returned_index' equals getPointCount()
-1 (largest possible index), getTime(
returned_index )
== aTimeStamp.
If the given time stamp is not in the interval
[getBeginTime()
, getEndTime()
],
-1 is returned.aTimeStamp
- The timestamp for which the index is requested.getTime(int)
public ILcdTimeBounds getTimeBounds()
ILcdTimeBounded
ILcdTimeBounds
by which this object is bounded.getTimeBounds
in interface ILcdTimeBounded
ILcdTimeBounds
by which this object is bounded.public long getBeginTime()
getTimeBounds()
.getTimeBounds()
public long getEndTime()
getTimeBounds()
.getTimeBounds()
public double getTrackHeading(int aIndex)
Double.NaN
if no heading is available.
Note: use Double.isNaN
to check if a value is Double.NaN
.aIndex
- The index to retrieve the heading value for. 0 <= aIndex
<= getPointCount().public Object getTrackFeature(int aIndex, int aFeatureIndex)
aIndex
- The index for the point for which you want to know the feature value. This index
corresponds to the index in getPoint(int aIndex)
.aFeatureIndex
- Determines what particular feature value you want to retrieve. Must be
smaller than getTrackFeatureCount()
.public Object getTrackValue(int aIndex, TLcdDataProperty aProperty)
getTrackFeature(int, int)
, but retrieves data objects instead of features.aIndex
- The index for the point for which you want to know the feature value. This index
corresponds to the index in getPoint(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 using getTrackDataType()
IllegalArgumentException
- if the given property was not declared in the data type of the tracks. See getTrackDataType()
public void setTrackValue(int aIndex, TLcdDataProperty aProperty, Object aValue)
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.
aIndex
- The trajectory index where you want the track value to change. Must be between 0 and
getPointCount()
.aProperty
- The track property whose value you want to change. Must not be null
and 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.IllegalArgumentException
- if the given property was not declared in the data type of the tracks. See getTrackDataType()
TLcdASTERIXTrack.getValue(com.luciad.datamodel.TLcdDataProperty)
public TLcdDataType getTrackDataType()
TLcdDataType
of the tracks of this trajectory.public int getTrackFeatureCount()
public int getFeatureCount()
ILcdFeatured
getFeatureCount
in interface ILcdFeatured
public Object getFeature(int aIndex) throws IndexOutOfBoundsException
ILcdFeatured
Object
at the given index.getFeature
in interface ILcdFeatured
aIndex
- a valid feature index.Object
at the given index.IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.ILcdFeatured.setFeature(int, java.lang.Object)
public void setFeature(int aIndex, Object aObject) throws IllegalArgumentException
ILcdFeatured
Object
at the given index.setFeature
in interface ILcdFeatured
aIndex
- a valid feature index.aObject
- the new feature Object
.IllegalArgumentException
- if the feature can't be set.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public boolean canSetFeature(int aIndex)
ILcdFeatured
canSetFeature
in interface ILcdFeatured
aIndex
- a valid feature index.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public Object getValue(TLcdDataProperty aProperty)
ILcdDataObject
Returns 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 type
or in one of its super types.
Otherwise an IllegalArgumentException
is thrown.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public void setValue(TLcdDataProperty aProperty, Object aValue)
ILcdDataObject
Sets 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 type
or in one of its super types. In
other words, getDataType().getProperties().contains( aProperty ) should always be true.
Otherwise, the implementation should throw an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public Object getValue(String aPropertyName)
ILcdDataObject
Convenience 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.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(String aPropertyName, Object aValue)
ILcdDataObject
Convenience 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.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic boolean hasValue(TLcdDataProperty aProperty)
ILcdDataObject
aProperty
is from the right data type
, and this instance has a value for it: returns true
aProperty
is from the right data type
, and this instance has no value for it: returns false
aProperty
is not from the right data type
: not allowed, you will get IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(String aPropertyName)
ILcdDataObject
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.