|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.proj.Proj
com.bbn.openmap.proj.UTMProjection
A OpenMap Projection class that uses the UTMPoint
to do its calculation.
Field Summary | |
protected int |
half_world
|
protected int |
hy
|
protected float |
ppu
Pixel per map unit. |
static int |
UTMType
The UTMType number. |
protected java.awt.Point |
world
|
protected int |
wx
|
protected java.awt.geom.Point2D.Double |
xycenter
Center of view as xy coordinates relative to the underlying projection |
Fields inherited from class com.bbn.openmap.proj.Proj |
ctrLat, ctrLon, DATELINE, height, maxscale, mercator, MIN_HEIGHT, MIN_WIDTH, minscale, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, projID, scale, scaled_radius, SOUTH_POLE, type, width, XSCALE_THRESHOLD, XTHRESHOLD |
Constructor Summary | |
UTMProjection(LatLonPoint center,
float s,
int w,
int h,
int type,
int zone_number,
boolean isnorthern,
Ellipsoid ellps)
|
Method Summary | |
protected java.util.ArrayList |
_forwardPoly(float[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a lat/lon Poly. |
protected void |
computeParameters()
Called when some fundamental parameters change. |
void |
drawBackground(java.awt.Graphics g)
Assume that the Graphics has been set with the Paint/Color needed, just render the shape of the background. |
void |
drawBackground(java.awt.Graphics2D g,
java.awt.Paint paint)
Draw the background for the projection. |
java.awt.Point |
forward(float lat,
float lon,
java.awt.Point pt)
Forward projects lat,lon coordinates into XY space and returns a Point. |
java.awt.Point |
forward(float lat,
float lon,
java.awt.Point pt,
boolean isRadian)
Forward projects lat,lon coordinates into XY space and returns a Point. |
java.awt.Point |
forward(LatLonPoint llp,
java.awt.Point pt)
Forward projects a LatLonPoint into XY space and return a Point. |
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
int[] xcoords,
int[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of radian points. |
LatLonPoint |
getLowerRight()
Get the lower right (southeast) point of the projection. |
float |
getScale(LatLonPoint ll1,
LatLonPoint ll2,
java.awt.Point point1,
java.awt.Point point2)
Given a couple of points representing a bounding box, find out what the scale should be in order to make those points appear at the corners of the projection. |
LatLonPoint |
getUpperLeft()
Get the upper left (northwest) point of the projection. |
LatLonPoint |
inverse(int x,
int y,
LatLonPoint llpt)
Inverse project x,y coordinates into a LatLonPoint. |
LatLonPoint |
inverse(java.awt.Point point,
LatLonPoint llpt)
Inverse project a point with llpt. |
boolean |
isPlotable(float lat,
float lon)
Checks if a LatLonPoint is plot-able. |
float |
normalize_latitude(float lat)
Sets radian latitude to something sane. |
Methods inherited from class com.bbn.openmap.proj.Proj |
clone, doPolyDispatch, equals, forward, forward, forwardArc, forwardArc, forwardArc, forwardCircle, forwardCircle, forwardCircle, forwardGreatPoly, forwardLine, forwardLine, forwardPoly, forwardPoly, forwardRaster, forwardRect, forwardRect, forwardRect, forwardRhumbPoly, getCenter, getHeight, getMaxScale, getMinScale, getName, getPlanetPixelCircumference, getPlanetPixelRadius, getPlanetRadius, getPPM, getProjectionID, getProjectionType, getScale, getWidth, hashCode, init, inverse, inverse, isComplicatedLineType, isPlotable, makeClone, pan, pan, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setCenter, setHeight, setMaxScale, setMinScale, setParms, setPlanetRadius, setPPM, setProjectionID, setScale, setWidth, toString, wrap_longitude |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.awt.geom.Point2D.Double xycenter
protected int hy
protected int wx
protected float ppu
protected java.awt.Point world
protected int half_world
public static final transient int UTMType
Constructor Detail |
public UTMProjection(LatLonPoint center, float s, int w, int h, int type, int zone_number, boolean isnorthern, Ellipsoid ellps)
Method Detail |
protected void computeParameters()
Proj
Each projection will decide how to respond to this change. For instance, they may need to recalculate "constant" paramters used in the forward() and inverse() calls.
computeParameters
in class Proj
public float normalize_latitude(float lat)
Proj
Normalizes the latitude according to the particular projection.
normalize_latitude
in class Proj
lat
- float latitude in radians
ProjMath.normalize_latitude(float, float)
,
LatLonPoint.normalize_latitude(float)
public java.awt.Point forward(LatLonPoint llp, java.awt.Point pt)
Projection
llp
- LatLonPoint to be projectedpt
- Resulting XY Point
public java.awt.Point forward(float lat, float lon, java.awt.Point pt)
Projection
lat
- float latitude in decimal degreeslon
- float longitude in decimal degreespt
- Resulting XY Point
public java.awt.Point forward(float lat, float lon, java.awt.Point pt, boolean isRadian)
Projection
lat
- float latitude in radianslon
- float longitude in radianspt
- Resulting XY PointisRadian
- placeholder argument indicating that lat,lon
arguments are in radians (can be true or false)
Projection.forward(float,float,Point)
public LatLonPoint inverse(java.awt.Point point, LatLonPoint llpt)
Projection
point
- x,y Pointllpt
- resulting LatLonPoint
public LatLonPoint inverse(int x, int y, LatLonPoint llpt)
Projection
x
- integer x coordinatey
- integer y coordinatellpt
- LatLonPoint
Proj.inverse(Point)
public float getScale(LatLonPoint ll1, LatLonPoint ll2, java.awt.Point point1, java.awt.Point point2)
getScale
in interface Projection
getScale
in class Proj
ll1
- the upper left coordinates of the bounding box.ll2
- the lower right coordinates of the bounding box.point1
- a java.awt.Point reflecting a pixel spot on the projection
that matches the ll1 coordinate, the upper left corner of the
area of interest.point2
- a java.awt.Point reflecting a pixel spot on the projection
that matches the ll2 coordinate, usually the lower right
corner of the area of interest.public boolean isPlotable(float lat, float lon)
Projection
Call this to check and see if a LatLonPoint can be plotted. This is meant to be used for checking before projecting and rendering Point objects (bitmaps or text objects tacked at a LatLonPoint for instance).
lat
- float latitude in decimal degreeslon
- float longitude in decimal degrees
protected java.util.ArrayList _forwardPoly(float[] rawllpts, int ltype, int nsegs, boolean isFilled)
Proj
_forwardPoly
in class Proj
rawllpts
- float[] of lat,lon,lat,lon,... in RADIANS!ltype
- line type (straight, rhumbline, greatcircle)nsegs
- number of segment points (only for greatcircle or rhumbline
line types, and if < 1, this value is generated internally)isFilled
- filled poly?
public void drawBackground(java.awt.Graphics2D g, java.awt.Paint paint)
drawBackground
in class Proj
g
- Graphics2Dpaint
- java.awt.Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
drawBackground
in class Proj
public boolean forwardRaw(float[] rawllpts, int rawoff, int[] xcoords, int[] ycoords, boolean[] visible, int copyoff, int copylen)
Projection
It does populate a visible array indicating whether the points are visible on the projected view of the world.
rawllpts
- array of lat,lon,... in RADIANS!rawoff
- offset into rawllptsxcoords
- x coordinatesycoords
- y coordinatesvisible
- coordinates visible?copyoff
- offset into x,y,visible arrayscopylen
- number of coordinates (coordinate arrays should
be at least this long, rawllpts should be at least twice
as long).
public LatLonPoint getLowerRight()
Projection
Returns the lower right point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
public LatLonPoint getUpperLeft()
Projection
Returns the upper left point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |