Package com.luciad.shape.shape2D
Class TLcdLonLatPoint
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdPoint
com.luciad.shape.shape2D.ALcd2DEditablePoint
com.luciad.shape.shape2D.TLcdLonLatPoint
- All Implemented Interfaces:
ILcdBounded,ILcdBounds,ILcdPoint,ILcdPointList,ILcdPolypoint,ILcdShape,ILcd2DEditablePoint,ILcd2DEditableShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
TLcdLonLatMPoint,TLcdLonLatZonalPoint
This class provides an implementation of
ILcd2DEditablePoint in the geodetic
space.
All longitude/latitude coordinates are expressed in degrees.
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.
Use as a domain object
If you plan on usingTLcdLonLatPoint as a domain object (e.g. using ILcdModel.addElement),
please note that two TLcdLonLatPoint instances are considered to be equal if they describe
the same location. If location does not uniquely identify your domain objects, please override
equals/hashcode to take the additional properties into account.
Alternatively, one could consider every class instance different, resulting in these
equals/hashcode implementations:
public boolean equals( Object aObject ) {
return aObject == this;
}
public int hashCode() {
return System.identityHashCode( this );
}
Failing to respect equals/hashcode may result in undesired behavior, for example when performing
spatial queries, used during painting.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdLonLatPointwith its coordinates set to 0.TLcdLonLatPoint(double aLon, double aLat) TLcdLonLatPoint(ILcdPoint aPoint) Constructs a newTLcdLonLatPointthat is a copy of the givenILcdPoint. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of thisILcdBoundsobject that is also anILcd2DEditableBounds.Returns a copy of thisILcdPointthat is also anILcd2DEditablePoint.Returns a copy of thisILcdBoundsobject that is also anILcd3DEditableBounds.Returns a copy of thisILcdPointthat is also anILcd3DEditablePoint.booleancontains2D(double aLon, double aLat) Checks whether thisALcdPointis equal to the given point in the 2D cartesian plane.booleancontains2D(double aLon, double aLat, double aWidth, double aHeight) Checks whether thisILcdBoundsobject contains the given rectangle in the 2D space.booleanChecks whether the object has the same class as this object and whether the coordinates are equal or differ by 360 for longitudes.final doublegetCosX()Returns cos(getX()* DEG2RAD ).final doublegetCosY()Returns cos(getY()* DEG2RAD ).final doublegetLat()final doublegetLon()final doublegetSinX()Returns sin(getX()* DEG2RAD ).final doublegetSinY()Returns sin(getY()* DEG2RAD ).final doublegetTanX()Returns tan(getX()* DEG2RAD ).final doublegetTanY()Returns tan(getY()* DEG2RAD ).final doublegetX()Returns the x coordinate of thisILcdPoint.final doublegetY()Returns the y coordinate of thisILcdPoint.booleaninteracts2D(double aLon, double aLat, double aWidth, double aHeight) Checks whether thisILcdBoundsobject interacts with the given rectangle in the 2D space.voidmove2D(double aLon, double aLat) Sets the longitude and latitude of thisILcd2DEditablePoint.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditablePoint
getZ, move2D, toString, translate2DMethods inherited from class com.luciad.shape.ALcdPoint
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getHeight, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointCount, getWidth, hashCode, interacts2D, interacts3D, interacts3D, isDefinedMethods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D, translate2DMethods inherited from interface com.luciad.shape.ILcdBounded
getBoundsMethods inherited from interface com.luciad.shape.ILcdBounds
getCenterMethods inherited from interface com.luciad.util.ILcdCloneable
cloneMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
TLcdLonLatPoint
public TLcdLonLatPoint()Constructs a newTLcdLonLatPointwith its coordinates set to 0. -
TLcdLonLatPoint
Constructs a newTLcdLonLatPointthat is a copy of the givenILcdPoint.- Parameters:
aPoint- theILcdPointto copy.
-
TLcdLonLatPoint
public TLcdLonLatPoint(double aLon, double aLat) - Parameters:
aLon- longitude in decimal degrees, positive for Eastern hemisphere, negative for Western hemisphere.aLat- latitude in decimal degrees, positive for Northern hemisphere, negative for Southern hemisphere.
-
-
Method Details
-
getLon
public final double getLon() -
getLat
public final double getLat() -
getX
public final double getX()Description copied from interface:ILcdPointReturns the x coordinate of thisILcdPoint. -
getY
public final double getY()Description copied from interface:ILcdPointReturns the y coordinate of thisILcdPoint. -
getCosY
public final double getCosY()Description copied from interface:ILcdPointReturns cos(getY()* DEG2RAD ). -
getCosX
public final double getCosX()Description copied from interface:ILcdPointReturns cos(getX()* DEG2RAD ). -
getSinY
public final double getSinY()Description copied from interface:ILcdPointReturns sin(getY()* DEG2RAD ). -
getSinX
public final double getSinX()Description copied from interface:ILcdPointReturns sin(getX()* DEG2RAD ). -
getTanY
public final double getTanY()Description copied from interface:ILcdPointReturns tan(getY()* DEG2RAD ). -
getTanX
public final double getTanX()Description copied from interface:ILcdPointReturns tan(getX()* DEG2RAD ). -
cloneAs2DEditablePoint
Description copied from interface:ILcdPointReturns a copy of thisILcdPointthat is also anILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable,- Specified by:
cloneAs2DEditablePointin interfaceILcdPoint- Returns:
- a copy of this
ILcdPointthat is also anILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdPointobject may be read-only. - See Also:
-
cloneAs3DEditablePoint
Description copied from interface:ILcdPointReturns a copy of thisILcdPointthat is also anILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable,- Specified by:
cloneAs3DEditablePointin interfaceILcdPoint- Returns:
- a copy of this
ILcdPointthat is also anILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable, even if the originalILcdPointobject may be read-only. - See Also:
-
move2D
public void move2D(double aLon, double aLat) Sets the longitude and latitude of thisILcd2DEditablePoint.- Specified by:
move2Din interfaceILcd2DEditableShape- Parameters:
aLon- longitude in decimal degrees, positive for Eastern hemisphere, negative for Western hemisphere.aLat- latitude in decimal degrees, positive for Northern hemisphere, negative for Southern hemisphere.
-
interacts2D
public boolean interacts2D(double aLon, double aLat, double aWidth, double aHeight) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject interacts with the given rectangle in the 2D space. Only the first two dimensions of theILcdBoundsobject are considered.If this bounds is
undefined, the result is false.- Specified by:
interacts2Din interfaceILcdBounds- Overrides:
interacts2Din classALcdPoint- Parameters:
aLon- the x coordinate of the rectangle.aLat- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
trueif thisILcdBoundsobject touches or overlaps to any extent with the given rectangle,falseotherwise.
-
contains2D
public boolean contains2D(double aLon, double aLat) Description copied from class:ALcdPointChecks whether thisALcdPointis equal to the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Overrides:
contains2Din classALcdPoint- Parameters:
aLon- the x coordinate of the point.aLat- the y coordinate of the point.- Returns:
- the boolean result of the equality test.
-
contains2D
public boolean contains2D(double aLon, double aLat, double aWidth, double aHeight) Description copied from interface:ILcdBoundsChecks whether thisILcdBoundsobject contains the given rectangle in the 2D space. Only the first two dimensions of theILcdBoundsobject are considered.If this bounds is
undefined, the result is false.- Specified by:
contains2Din interfaceILcdBounds- Overrides:
contains2Din classALcdPoint- Parameters:
aLon- the x coordinate of the rectangle.aLat- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
- the boolean result of the containment test.
-
cloneAs2DEditableBounds
Description copied from interface:ILcdBoundsReturns a copy of thisILcdBoundsobject that is also anILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only.- Specified by:
cloneAs2DEditableBoundsin interfaceILcdBounds- Returns:
- a copy of this
ILcdBoundsobject that is also anILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only. - See Also:
-
cloneAs3DEditableBounds
Description copied from interface:ILcdBoundsReturns a copy of thisILcdBoundsobject that is also anILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only.- Specified by:
cloneAs3DEditableBoundsin interfaceILcdBounds- Returns:
- a copy of this
ILcdBoundsobject that is also anILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only. - See Also:
-
equals
Checks whether the object has the same class as this object and whether the coordinates are equal or differ by 360 for longitudes.
-