|
|||||||||||
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.AspectRatioProjection
A Projection that wraps another projection, but stretch the image to another aspect ratio.
The motivation for this projection is to support the following clause in wms 1.1.1.
OGC 01-068r3 (wms 1.1.1) 7.2.3.8. "In the case where the aspect ratio of the BBOX and the ratio width/height are different, the WMS shall stretch the returned map so that the resulting pixels could themselves be rendered in the aspect ratio of the BBOX"
Field Summary |
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 | |
AspectRatioProjection(Proj proj,
int w,
int h)
Constructor that takes a projection and the new width/height. |
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 p)
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. |
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, 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 |
Constructor Detail |
public AspectRatioProjection(Proj proj, int w, int h)
proj
- a projection to wrapw
- a int with the new widthh
- a int with the new heightMethod Detail |
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?
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 void drawBackground(java.awt.Graphics2D g, java.awt.Paint p)
Proj
drawBackground
in class Proj
g
- Graphics2Dp
- Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
Proj
drawBackground
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 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.
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 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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |