com.bbn.openmap.proj.coords
Class LatLonPoint.Float

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by com.bbn.openmap.proj.coords.LatLonPoint
          extended by com.bbn.openmap.proj.coords.LatLonPoint.Float
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Enclosing class:
LatLonPoint

public static class LatLonPoint.Float
extends LatLonPoint

The Float version of a LatLonPoint, where coordinates are held to float precision.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.proj.coords.LatLonPoint
LatLonPoint.Double, LatLonPoint.Float
 
Field Summary
protected  float lat
           
protected  float lon
           
protected  float radLat
           
protected  float radLon
           
 
Fields inherited from class com.bbn.openmap.proj.coords.LatLonPoint
DATELINE, LON_RANGE, NORTH_POLE, SOUTH_POLE
 
Constructor Summary
LatLonPoint.Float()
          Default constructor, values set to 0, 0.
LatLonPoint.Float(float lat, float lon)
           
LatLonPoint.Float(float lat, float lon, boolean isRadian)
           
LatLonPoint.Float(LatLonPoint llp)
          Create Float version from another LatLonPoint.
LatLonPoint.Float(java.awt.geom.Point2D pt2D)
          Create Float version from Point2D object, where the x, y values are expected to be decimal degrees.
 
Method Summary
 float getLatitude()
           
 float getLongitude()
           
 LatLonPoint getPoint(float dist, float az)
          Find a LatLonPoint a distance and direction away from this point, based on the spherical earth model.
 double getRadLat()
           
 double getRadLon()
           
 double getX()
          Point2D method.
 double getY()
          Point2D method
 void read(java.io.DataInputStream s)
          Read object.
 void read(java.io.DataInputStream s, boolean inRadians)
          Read object.
 void setLatitude(double lat)
          Set latitude.
 void setLatitude(float lat)
          Set latitude.
 void setLatLon(double lat, double lon)
          Set lat/lon values.
 void setLatLon(double lat, double lon, boolean isRadians)
          Set lat/lon values.
 void setLatLon(float lat, float lon)
          Set lat/lon values.
 void setLatLon(float lat, float lon, boolean isRadians)
          Set lat/lon values.
 void setLocation(double x, double y)
          Point2D method, inheriting signature!!
 void setLocation(float x, float y)
          Point2D method, inheriting signature!!
 void setLongitude(double lon)
          Set longitude.
 void setLongitude(float lon)
          Set longitude.
 java.lang.String toString()
           
 void write(java.io.DataOutputStream s)
          Write object.
 
Methods inherited from class com.bbn.openmap.proj.coords.LatLonPoint
azimuth, distance, equals, getDouble, getFloat, getPoint, isInvalidLatitude, isInvalidLongitude, normalizeLatitude, normalizeLatitude, setLatLon, wrapLongitude, wrapLongitude
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lat

protected float lat

lon

protected float lon

radLat

protected transient float radLat

radLon

protected transient float radLon
Constructor Detail

LatLonPoint.Float

public LatLonPoint.Float()
Default constructor, values set to 0, 0.


LatLonPoint.Float

public LatLonPoint.Float(float lat,
                         float lon)
Parameters:
lat - decimal degree latitude.
lon - decimal degree longitude.

LatLonPoint.Float

public LatLonPoint.Float(float lat,
                         float lon,
                         boolean isRadian)
Parameters:
lat - latitude
lon - longitude
isRadian - true if values are radians, false if decimal degrees.

LatLonPoint.Float

public LatLonPoint.Float(LatLonPoint llp)
Create Float version from another LatLonPoint.

Parameters:
llp -

LatLonPoint.Float

public LatLonPoint.Float(java.awt.geom.Point2D pt2D)
Create Float version from Point2D object, where the x, y values are expected to be decimal degrees.

Parameters:
pt2D -
Method Detail

setLocation

public void setLocation(float x,
                        float y)
Point2D method, inheriting signature!!

Parameters:
x - longitude value in decimal degrees.
y - latitude value in decimal degrees.

setLocation

public void setLocation(double x,
                        double y)
Point2D method, inheriting signature!!

Specified by:
setLocation in class java.awt.geom.Point2D
Parameters:
x - longitude value in decimal degrees.
y - latitude value in decimal degrees.

setLatLon

public void setLatLon(float lat,
                      float lon)
Set lat/lon values.

Parameters:
lat - decimal degree latitude.
lon - decimal degree longitude.

setLatLon

public void setLatLon(double lat,
                      double lon)
Set lat/lon values.

Specified by:
setLatLon in class LatLonPoint
Parameters:
lat - decimal degree latitude.
lon - decimal degree longitude.

setLatLon

public void setLatLon(double lat,
                      double lon,
                      boolean isRadians)
Set lat/lon values.

Specified by:
setLatLon in class LatLonPoint
Parameters:
lat - latitude.
lon - longitude.
isRadians - true if values are radians.

setLatLon

public void setLatLon(float lat,
                      float lon,
                      boolean isRadians)
Set lat/lon values.

Parameters:
lat - latitude.
lon - longitude.
isRadians - true if values are radians.

getX

public double getX()
Point2D method.

Specified by:
getX in class java.awt.geom.Point2D
Returns:
decimal degree longitude.
See Also:
Point2D.getX()

getY

public double getY()
Point2D method

Specified by:
getY in class java.awt.geom.Point2D
Returns:
decimal degree latitude.

getLongitude

public float getLongitude()
Specified by:
getLongitude in class LatLonPoint
Returns:
decimal degree longitude.

getLatitude

public float getLatitude()
Specified by:
getLatitude in class LatLonPoint
Returns:
decimal degree latitude.

getRadLon

public double getRadLon()
Specified by:
getRadLon in class LatLonPoint
Returns:
radian longitude.

getRadLat

public double getRadLat()
Specified by:
getRadLat in class LatLonPoint
Returns:
radian latitude.

setLatitude

public void setLatitude(float lat)
Set latitude.

Parameters:
lat - latitude in decimal degrees

setLatitude

public void setLatitude(double lat)
Set latitude.

Specified by:
setLatitude in class LatLonPoint
Parameters:
lat - latitude in decimal degrees

setLongitude

public void setLongitude(float lon)
Set longitude.

Parameters:
lon - longitude in decimal degrees

setLongitude

public void setLongitude(double lon)
Set longitude.

Specified by:
setLongitude in class LatLonPoint
Parameters:
lon - longitude in decimal degrees

getPoint

public LatLonPoint getPoint(float dist,
                            float az)
Find a LatLonPoint a distance and direction away from this point, based on the spherical earth model.

Parameters:
dist - distance, in radians.
az - radians of azimuth (direction) east of north (-PI <= Az < PI)
Returns:
LatLonPoint result

write

public void write(java.io.DataOutputStream s)
           throws java.io.IOException
Write object.

Parameters:
s - DataOutputStream
Throws:
java.io.IOException

read

public void read(java.io.DataInputStream s)
          throws java.io.IOException
Read object. Assumes that the floats read off the stream will be in decimal degrees. Latitude read off the stream first, then longitude.

Parameters:
s - DataInputStream
Throws:
java.io.IOException

read

public void read(java.io.DataInputStream s,
                 boolean inRadians)
          throws java.io.IOException
Read object. Latitude read off the stream first, then longitude.

Parameters:
s - DataInputStream
inRadians - if true, the floats read off stream will be considered to be radians. Otherwise, they will be considered to be decimal degrees.
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details