com.bbn.openmap.proj
Class LLXY

java.lang.Object
  extended by com.bbn.openmap.proj.Proj
      extended by com.bbn.openmap.proj.GeoProj
          extended by com.bbn.openmap.proj.Cylindrical
              extended by com.bbn.openmap.proj.LLXY
All Implemented Interfaces:
EqualArc, Projection, java.io.Serializable, java.lang.Cloneable

public class LLXY
extends Cylindrical
implements EqualArc

Implements the LLXY projection, which is basically something where the lat/lon and pixel ratios are the same.

See Also:
Serialized Form

Field Summary
protected  double cLat
           
protected  double cLon
           
protected  double cLonRad
           
static double epsilon
           
protected  double hy
           
static java.lang.String LLXYName
          The LLXY name.
protected  double ppd
          Pixel per degree
protected  double wx
           
 
Fields inherited from class com.bbn.openmap.proj.Cylindrical
half_world, world
 
Fields inherited from class com.bbn.openmap.proj.GeoProj
DATELINE, mercator, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, scaled_radius, SOUTH_POLE, XSCALE_THRESHOLD, XTHRESHOLD
 
Fields inherited from class com.bbn.openmap.proj.Proj
centerX, centerY, height, maxscale, MIN_HEIGHT, MIN_WIDTH, minscale, projID, rotationAngle, scale, ucuom, width
 
Constructor Summary
LLXY(LatLonPoint center, float scale, int width, int height)
          Construct a LLXY projection.
 
Method Summary
protected  void computeParameters()
          Called when some fundamental parameters change.
static LLXY convertProjection(Projection proj)
           
 java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D p, boolean isRadian)
          Forward projects lat,lon into XY space and returns a Point2D.
 java.lang.String getName()
          Get the name string of the projection.
 double getXPixConstant()
          Returns the x pixel constant of the projection.
 double getYPixConstant()
          Returns the y pixel constant of the projection.
<T extends java.awt.geom.Point2D>
T
inverse(double x, double y, T llp)
          Inverse project x,y coordinates into a LatLonPoint.
 boolean isPlotable(double lat, double lon)
          Checks if a LatLonPoint is plot-able.
 double normalizeLatitude(double lat)
          Sets radian latitude to something sane.
 double normalizeLatitudeDeg(double lat)
           
 java.lang.String toString()
          Return stringified description of this projection.
 
Methods inherited from class com.bbn.openmap.proj.Cylindrical
_forwardPoly, _forwardPoly, dumpPoly, dumpPoly, forwardRaw, forwardRaw, getLowerRight, getUpperLeft, init
 
Methods inherited from class com.bbn.openmap.proj.GeoProj
assertLatLonPoint, clone, doPolyDispatch, doPolyDispatch, forward, forward, forward, forward, forwardArc, forwardArc, forwardArc, forwardCircle, forwardCircle, forwardCircle, forwardGreatPoly, forwardGreatPoly, forwardLine, forwardLine, forwardLLPoly, forwardPoly, forwardPoly, forwardRect, forwardRect, forwardRect, forwardRhumbPoly, forwardRhumbPoly, getCenter, getCenter, getGCTForProjection, getPlanetPixelCircumference, getPlanetPixelRadius, getPlanetRadius, getPPM, getReferenceLon, getScale, getUcuom, inverse, inverse, isComplicatedLineType, isPlotable, normalize_latitude, normalizeLatitude, pan, pan, setCenter, setCenter, setCenter, setPlanetRadius, setPPM, setUcuom, wrap_longitude, wrapLongitude, wrapLongitude, wrapLongitudeDeg
 
Methods inherited from class com.bbn.openmap.proj.Proj
drawBackground, drawBackground, equals, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRect, forwardShape, getHeight, getMaxScale, getMinScale, getProjectionID, getRotationAngle, getScale, getWidth, hashCode, inverse, inverseShape, makeClone, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setHeight, setMaxScale, setMinScale, setParms, setProjectionID, setRotationAngle, setScale, setWidth
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.proj.Projection
forward, forward, forward, forward, forward, forward, forwardLine, forwardPoly, forwardPoly, forwardRaw, forwardRaw, forwardRect, forwardShape, getCenter, getCenter, getHeight, getLowerRight, getMaxScale, getMinScale, getProjectionID, getRotationAngle, getScale, getScale, getUcuom, getUpperLeft, getWidth, inverse, inverse, inverse, inverseShape, isPlotable, makeClone, pan, pan
 

Field Detail

LLXYName

public static final transient java.lang.String LLXYName
The LLXY name.

See Also:
Constant Field Values

epsilon

public static final transient double epsilon
See Also:
Constant Field Values

hy

protected double hy

wx

protected double wx

cLon

protected double cLon

cLonRad

protected double cLonRad

cLat

protected double cLat

ppd

protected double ppd
Pixel per degree

Constructor Detail

LLXY

public LLXY(LatLonPoint center,
            float scale,
            int width,
            int height)
Construct a LLXY projection.

Parameters:
center - LatLonPoint center of projection
scale - float scale of projection
width - width of screen
height - height of screen
Method Detail

toString

public java.lang.String toString()
Return stringified description of this projection.

Overrides:
toString in class Cylindrical
Returns:
String
See Also:
Projection.getProjectionID()

computeParameters

protected void computeParameters()
Called when some fundamental parameters change. Each projection will decide how to respond to this change. For instance, they may need to recalculate "constant" parameters used in the forward() and inverse() calls.

Overrides:
computeParameters in class Cylindrical

normalizeLatitude

public double normalizeLatitude(double lat)
Sets radian latitude to something sane. This is an abstract function since some projections don't deal well with extreme latitudes.

Specified by:
normalizeLatitude in class GeoProj
Parameters:
lat - float latitude in radians
Returns:
float latitude (-PI/2 <= y <= PI/2)

normalizeLatitudeDeg

public double normalizeLatitudeDeg(double lat)

isPlotable

public boolean isPlotable(double lat,
                          double lon)
Checks if a LatLonPoint is plot-able. This method is changed for 5.0. Previously, a point is always plot-able in the LLXY projection and that's because the llxy projection was kind of the cartesian coordinate system for OpenMap. I think we should start assuming that the llxy projection is kind of limited to plotable points on the Earth. So, we're checking that now.

Specified by:
isPlotable in interface Projection
Overrides:
isPlotable in class Proj
Parameters:
lat - float latitude in decimal degrees
lon - float longitude in decimal degrees
Returns:
boolean if lat is between 90 and -90, lon between 180 and -180;

forward

public java.awt.geom.Point2D forward(double lat,
                                     double lon,
                                     java.awt.geom.Point2D p,
                                     boolean isRadian)
Forward projects lat,lon into XY space and returns a Point2D.

Specified by:
forward in class GeoProj
Parameters:
lat - float latitude in radians
lon - float longitude in radians
p - Resulting XY Point2D
isRadian - bogus argument indicating that lat,lon arguments are in radians
Returns:
Point2D p

inverse

public <T extends java.awt.geom.Point2D> T inverse(double x,
                                                   double y,
                                                   T llp)
Inverse project x,y coordinates into a LatLonPoint.

Specified by:
inverse in interface Projection
Specified by:
inverse in class Proj
Parameters:
x - integer x coordinate
y - integer y coordinate
llp - LatLonPoint
Returns:
LatLonPoint llp
See Also:
Proj.inverse(Point2D)

getName

public java.lang.String getName()
Get the name string of the projection.

Specified by:
getName in interface Projection
Overrides:
getName in class Cylindrical

getXPixConstant

public double getXPixConstant()
Returns the x pixel constant of the projection. This was calculated when the projection was created. Represents the number of pixels around the earth (360 degrees).

Specified by:
getXPixConstant in interface EqualArc

getYPixConstant

public double getYPixConstant()
Returns the y pixel constant of the projection. This was calculated when the projection was created. Represents the number of pixels from 0 to 90 degrees.

Specified by:
getYPixConstant in interface EqualArc

convertProjection

public static LLXY convertProjection(Projection proj)


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