Class TLcdLonLatBuffer
- All Implemented Interfaces:
ILcdBounded,ILcdPointList,ILcdShape,ILcd2DEditablePointList,ILcd2DEditableShape,ILcdCache,ILcdCloneable,Serializable,Cloneable
All longitude/latitude coordinates are expressed in degrees. Lengths are expressed in meters.
The buffer's width is from the axis to the edge of the buffer on both sides, so the buffer is 2 * width wide.
This buffer implementation has the following limitations:
- for efficiency reasons the current implementation works with a spherical approximation where the radius of the sphere is the major axis of the ellipsoid.
- contours with holes (i.e., caused by axis intersections) cannot
be represented, since the contour is modeled as a single polygon (
ILcdPolygon), - the corners of the contour at the axis points are sharp instead of rounded, which make it less suitable for buffers that have sharp angles between its consecutive axis segments; it has also has as consequence that the distance between the contour and the axis exceeds the given buffer distance in the corners,
- the calculated contour is only an estimate, because it uses a reduced number of contour points; when the start and end point of a segment are further removed from each other, the connected contour lines no longer lie at the given distance from the axis at each intermediate point.
TLcdLonLatGeoBuffer and TLcdEllipsoidUtil.computeBufferContour2D.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray, double aWidth) Creates a newTLcdLonLatBufferwith the specified parameters.TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray, double aWidth, ILcdEllipsoid aEllipsoid) Creates a newTLcdLonLatBufferwith the specified parameters.TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline, double aWidth) Creates a newTLcdLonLatBufferwith the specified parameters.TLcdLonLatBuffer(TLcdLonLatPolyline aAxisPolyline, double aWidth, ILcdEllipsoid aEllipsoid) Creates a newTLcdLonLatBufferwith the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.clone()Creates and returns a copy of this object.booleancontains2D(double x, double y) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisALcdShapecontains the given point in the 2D cartesian plane.booleanReturns whether the given object has the same class, coordinates, and radius.final ILcd2DEditablePolylineReturns 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 focus point of thisILcdShape.final ILcdPointgetPoint(int aIndex) Returns theILcdPointat a given index.final intReturns the number ofILcdPointobjects in the list.final doublegetWidth()Returns the distance from the axis to the buffer edge.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.voidinsert2DPoint(int aIndex, double aX, double aY) Inserts a point at the given index into thisILcd2DEditablePointList.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.voidmove2D(double aX, double aY) Translates this shape so that its focus point ends up at the specified position.voidmove2DPoint(int aIndex, double aX, double aY) Moves the specified point of thisILcd2DEditablePointListto the given point in the 2D space.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidremovePointAt(int aIndex) Removes the point at the given index from thisILcd2DEditablePointList.voidsetEllipsoid(ILcdEllipsoid aEllipsoid) voidsetWidth(double aWidth) Set the distance is from the axis to the buffer edge.toString()voidtranslate2D(double aX, double aY) Translates all the points of thisILcd2DEditablePointListfrom their current positions over the given translation vector in the 2D space.voidtranslate2DPoint(int aIndex, double aX, double aY) Translates the specified point of thisILcd2DEditablePointListfrom its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2DMethods inherited from class com.luciad.shape.ALcdShape
contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditablePointList
append2DPointMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdShape
contains3D
-
Constructor Details
-
TLcdLonLatBuffer
Creates a newTLcdLonLatBufferwith the specified parameters.- Parameters:
aAxisPolyline- the polyline defining the axis of the corridor.aWidth- the width in meters of the corridor, from the axis to the buffer edge
-
TLcdLonLatBuffer
public TLcdLonLatBuffer(ILcd2DEditablePoint[] aAxisPointArray, double aWidth, ILcdEllipsoid aEllipsoid) Creates a newTLcdLonLatBufferwith the specified parameters.- Parameters:
aAxisPointArray- the array of points defining the axis of the corridor.aWidth- the width in meters of the corridor, from the axis to the buffer edge
-
TLcdLonLatBuffer
Creates a newTLcdLonLatBufferwith the specified parameters.- Parameters:
aAxisPolyline- the polyline defining the axis of the corridor.aWidth- the width in meters of the corridor, from the axis to the buffer edge
-
TLcdLonLatBuffer
Creates a newTLcdLonLatBufferwith the specified parameters.- Parameters:
aAxisPointArray- the array of points defining the axis of the corridor.aWidth- the width in meters of the corridor, from the axis to the buffer edge
-
TLcdLonLatBuffer
public TLcdLonLatBuffer()
-
-
Method Details
-
getWidth
public final double getWidth()Returns the distance from the axis to the buffer edge.The buffer is 2 * width wide in total.
- Returns:
- The width of the buffer, from axis to edge
-
setWidth
public void setWidth(double aWidth) Set the distance is from the axis to the buffer edge. The buffer is 2 * width wide in total.- Parameters:
aWidth- the width in meters of the corridor (>= 0), from axis to the edge
-
getEllipsoid
-
setEllipsoid
-
getPointCount
public final 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.
-
removePointAt
public void removePointAt(int aIndex) Description copied from interface:ILcd2DEditablePointListRemoves the point at the given index from thisILcd2DEditablePointList.- Specified by:
removePointAtin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.
-
move2D
public void move2D(double aX, double aY) Description copied from class:ALcd2DEditableShapeTranslates this shape so that its focus point ends up at the specified position.- Specified by:
move2Din interfaceILcd2DEditableShape- Overrides:
move2Din classALcd2DEditableShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.
-
translate2D
public void translate2D(double aX, double aY) Description copied from interface:ILcd2DEditablePointListTranslates all the points of thisILcd2DEditablePointListfrom their current positions over the given translation vector in the 2D space. Only the first two dimensions of the points are considered. The third dimension is left unchanged.- Specified by:
translate2Din interfaceILcd2DEditablePointList- Specified by:
translate2Din interfaceILcd2DEditableShape- Parameters:
aX- the x coordinate of the translation vector.aY- the y coordinate of the translation vector.
-
move2DPoint
public void move2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointListMoves the specified point of thisILcd2DEditablePointListto the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
move2DPointin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid index in the list of points.aX- the x coordinate of the point.aY- the y coordinate of the point.
-
translate2DPoint
public void translate2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointListTranslates the specified point of thisILcd2DEditablePointListfrom its current position over the given translation vector in the 2D space. Only the first two dimensions of the points are considered. The third dimension is left unchanged.- Specified by:
translate2DPointin interfaceILcd2DEditablePointList- Parameters:
aX- the x coordinate of the translation vector.aY- the y coordinate of the translation vector.
-
insert2DPoint
public void insert2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointListInserts a point at the given index into thisILcd2DEditablePointList.- Specified by:
insert2DPointin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid new index in the list of points.aX- the x coordinate of the new point.aY- the y coordinate of the new point.
-
getContour
-
getAxisPolyline
-
contains2D
Description copied from class:ALcdShapeChecks whether thisALcdShapecontains the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Overrides:
contains2Din classALcdShape- Parameters:
aPoint- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double x, double y) 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:
x- the x coordinate of the point.y- the y 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.
-
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.
-
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
-
clone
Creates and returns a copy of this object.The contained ellipsoid and axis polyline are copied without being cloned.
The cache is not copied or cloned at all.
- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdShape- See Also:
-
equals
Returns whether the given object has the same class, coordinates, and radius. -
hashCode
public int hashCode()Description copied from class:ALcdShapeThe hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method. Extensions should refine this implementation, based on their properties. -
toString
-